-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add browser and module field support to package.json processing #2433
Comments
It looks like: https://github.com/angular/core-builds/blob/master/package.json#L7 Angular uses Syntax idea:
... to mean it should look for those fields, in that order. |
Any idea how hard this would be to implement? ClojureScript compiler Node module indexing already supports With a very quick glance, looks like RewriteJsonToModule/visitScript for package.json files would need to be updated to check the configured fields: https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/RewriteJsonToModule.java#L139 Example case:
|
I think this ticket can now be closed. |
Closure-compiler uses the standard node field
main
in a package.json to locate the entry point of a package. However, several other defacto standards have emerged including themodule
andbrowser
fields. We need to honor those.Also, it's become increasingly common for build tooling to add their own field and use that. Angular is using
es2015:main
andesnext:main
fields. We should provide a flag to allow specifying a custom set and order of fields to search.See the discussion in #2413
The text was updated successfully, but these errors were encountered: