You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our project we have a dist folder with ESM builds for use in projects using npm. Additionally, in dist/browser we have ESM and UMD builds that can be used directly in the browser.
Since we have "type": "module" in package.json, publint throws an error if the file containing require() doesn't have the .cjs extension. However, UMD uses require() and we don't want to change the extension to .cjs, because it won't work in the browser.
Since we use the exports field, I tried using Subpath patterns, which allows you to exclude "private" subfolders using the null target like this:
With this configuration, I can't get into the browser folder. However, publint doesn't respect the second rule and throws the following error:
pkg.exports["./*"] matches ./dist/browser/<FILENAME>.umd.js and is written in CJS, but is interpreted as ESM. Consider using the .cjs extension, e.g. ./dist/browser/<FILENAME>.umd.cjs
The text was updated successfully, but these errors were encountered:
In our project we have a
dist
folder with ESM builds for use in projects using npm. Additionally, indist/browser
we have ESM and UMD builds that can be used directly in the browser.Since we have
"type": "module"
inpackage.json
, publint throws an error if the file containingrequire()
doesn't have the.cjs
extension. However, UMD usesrequire()
and we don't want to change the extension to.cjs
, because it won't work in the browser.Since we use the
exports
field, I tried using Subpath patterns, which allows you to exclude "private" subfolders using thenull
target like this:With this configuration, I can't get into the
browser
folder. However, publint doesn't respect the second rule and throws the following error:The text was updated successfully, but these errors were encountered: