posthtml / htmlnano

Modular HTML minifier, built on top of the PostHTML

Home Page:https://htmlnano.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Types don't work using `"module": "NodeNext"` in TypeScript

sondr3 opened this issue · comments

This is obviously not a problem on your end but I've been unable to figure out how to fix it for myself. I'm writing a CLI tool using "module": "NodeNext" and "moduleResolution": "NodeNext" and it can't find typings for anything. I get the following error when type checking

error TS2614: Module '"htmlnano"' has no exported member 'HtmlnanoOptions'. Did you mean to use 'import HtmlnanoOptions from "htmlnano"' instead?

and all fields exported from htmlnano are marked with any. I tried to figure out the magic incantation of which files to export where but couldn't make any headway. Any ideas for how to fix this?

Sorry, I'm not sure how to fix it.

Maybe other contributors have some ideas?

commented

I don't have any ideas either. We already export the option type, there is no reason that TypeScript can't find it:

export interface HtmlnanoOptions {

A PR will be welcome!