Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add options and hooks to control module side effects (#2844)
* Implement basic support for returning the `pure` flag from `resolveId` * Handle conflicts between different resolutions by defaulting to impure * Add no-inferrable-types rule * Handle conflicts between resolutions without an opinion about pureness and others * Add purity to getModuleInfo, change logic to only use the first resolution to determine purity * Implement pureInternalModules and use as default * Split test, regenerate iterator on demand * Switch form pure to moduleSideEffects * Replace pureInternalModules with hasModuleSideEffects and refine logic * Implement load and transform hook handling * Test all versions of the moduleSideEffects option * Explain deprecation alternatives in JSDoc * Document new options * Try to fix Windows tests * Rename test folder, mark modules as executed in LocalVariable * Refine and simplify interaction of plugins with the user option. Now plugins always override the user option. * Add an option for this.resolve to skip the plugin calling it * Add "isEntry" to "getModuleInfo" * Provide "isEntry" information already in the load hook.
- Loading branch information
1 parent
7d669eb
commit 1de599f
Showing
52 changed files
with
1,099 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.