Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the current
--experimental-modulesimplementation based on the work of the modules team and reflects Phase 2 of our new modules plan.A longer form description of these changes can be found in our draft blog post.
The largest differences from the current implementation include
packge.typewhich can be eithermoduleorcommonjstype: "commonjs":.jsis parsed as commonjstype: "module":.jsis parsed as esm--type=[mode]to let you set the type on entry point. Will overridepackage.typefor entry point..cjs.modulemode.--es-module-specifier-resolution=[type]explicit(default) andnode--es-module-specifier-resolution=nodeto enable the commonjs specifier resolution algorithm--experimental-json-loader"type": "module"import 'thing.json'will go through the experimental loader independent of modepackage.mainto set an entry point for a moduletypeof the module