Closed huozhi closed 3 years ago
I can see that main: README.md
doesn't make much sense but will removing the main field help? From my understanding, a missing main field is roughly equivalent to main: index.js
.
@RunDevelopment I'm not sure how bundler handle package with any entry. If it's required to have one, do you feel it's proper to change the main entry to a empty one, like fbjs/index.js ?
// index.js
throw new Error('This package should not be required without a full path.');
Hmmm, I don't really like having a useless JS file just work around this.
Question: Have you checked that removing the main
field actually fixes your problem? If it works with the bundler you use, it'll probably also work with others.
yeah I've tested locally with removing main field from package.json in node_modules, problem solved. I'd expect regular css imports with absolute path won't cause this issue.
If it works for you, it'll probably also work for others. Right now, it just can't work, so let's merge this.
Thank you @RunDevelopment
e.g.
browserless
is depending onprism-themes
. when I use pkg to bundle a script using browserless. prism-themes is failed to be bundled