webpack.js.org
webpack.js.org copied to clipboard
webpackExports magic comment
Feature to document
import(/* webpackExports: "exportName" */ './utils.js')
import(/* webpackExports: ["exportNameA", "exportNameB", "default"] */ './utils.js')
Allows to manually pick the exports which should be exposed. Allows to tree shake the others.
Author(s)
@pushkar100
Additional information
Should be listed here:
- https://webpack.js.org/guides/tree-shaking/
- https://webpack.js.org/guides/code-splitting/#dynamic-imports
Is already listed here:
- https://webpack.js.org/api/module-methods/#magic-comments
[ ] I am willing to work on this issue and submit a pull request.
Since the code examples in those guides are deeply coupled, it would be almost impossible to incorporate new contents into those guides without drastically changes. We'll see how we can improve the situation.