np icon indicating copy to clipboard operation
np copied to clipboard

Support ESM only for the config file

Open sindresorhus opened this issue 3 years ago • 1 comments

No matter whether "type": "module" is used in package.json, we should use ESM for the config file.

Blocked by https://github.com/davidtheclark/cosmiconfig/issues/224.

sindresorhus avatar Feb 06 '21 10:02 sindresorhus

Is cosmiconfig really needed here? It seems to me that a specific solution for np would be easier to do.

Also, cosmiconfig does all that "searching up the directory tree" stuff, which is great for more complex configuration tools and linters and all that, but a project that uses an np-config, will only ever have one file per package.json. So in most cases just one config file, which is in the project root directory, right?

I also feel like np as a whole moving to ESM would fix this issue "automatically" and is the end goal anyway, as far as I understand. I'll open another issue to track this.

nnmrts avatar Feb 13 '21 15:02 nnmrts