-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for module
field
#859
Comments
This isn't a standard field, it's not one node will ever support, and it's a field that tools that currently support it (including webpack) will all definitely eventually drop once node ships native module support. I don't think it's a good idea to support it now, and I think it's a bug that https://github.com/bfred-it/webext-dynamic-content-scripts doesn't have a "main" field. |
Hmm I guess you're right about the I suppose I'll add a UMD file there then. |
That's better than nothing; I'd suggest never using a UMD either. Just use a normal ES5 CJS module for "main", and let consumers handle module format in their bundler. |
The package is mostly for the browser extensions, so honestly I don't expect many people using bundlers with it, even fewer using non-esm bundlers. UMD is ok for me at this point, even though I generally don't use it either. |
¯\_(ツ)_/¯ k, but anyone not using a bundler with anything in the browser, even extensions, is making a mistake. |
The package webext-dynamic-content-scripts does not have a
main
file but only amodule
file.eslint-plugin-import
is marking it as:Example:
For reference, both webpack@2 and rollup (+ its node resolution plugin) can successfully bundle it:
The text was updated successfully, but these errors were encountered: