Do you want to request a feature or report a bug?
I’d like to report a bug
What is the current behavior?
Tree shaking does not appear to be working. Dead code should be identified in the output bundle with a comment such as
/* unused harmony export _functionname_ */
If the current behavior is a bug, please provide the steps to reproduce.
Refer to the basic configuration in https://github.com/cdhgee/webpack-tree-shaking.
npm run build
- Examine the output in
dist/bundle.js. Around line 83, the exports from
another-module.jsshould be shown.
What is the expected behavior?
Functions c and d are not used anywhere in the project and should be identified with a comment such as
/* unused harmony export c */
Because these comments are missing, I conclude that either (a) tree shaking is not running, or (b) tree shaking is running but is not identifying c and d as dead code.
If this is a feature request, what is motivation or use case for changing the behavior?
Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System.
NodeJS version: 9.11.1 (64-bit)
Webpack version: 4.5.0
OS: Windows 10 1709 (64-bit)
These versions are all the most recent available as of today (2018-04-08).