Skip to content
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

Nested tree shaking is not working at webpack@3.0.0 #5100

Closed
navarroaxel opened this issue Jun 20, 2017 · 1 comment · Fixed by #5112
Closed

Nested tree shaking is not working at webpack@3.0.0 #5100

navarroaxel opened this issue Jun 20, 2017 · 1 comment · Fixed by #5112

Comments

@navarroaxel
Copy link

Do you want to request a feature or report a bug?
bug

What is the current behavior?
The tree shaking at 2nd level is not working in webpack@3.0.0, but it's working with webpack@2.6.1.

If the current behavior is a bug, please provide the steps to reproduce.
Just use a code like this twice:

if (!module.hot || process.env.NODE_ENV === 'production') {
    module.exports = require('./index.prod');
} else {
    module.exports = require('./index.dev');
}

The 2nd tree shaking doesn't work. You can see the issue in this repo: https://github.com/navarroaxel/webpack-tree-shaking-bug

Just run this:

git clone https://github.com/navarroaxel/webpack-tree-shaking-bug.git
cd webpack-tree-shaking-bug
yarn install
yarn run webpack
# ctrl+c to stop the bundle analyzer server
yarn add --dev webpack
#the webpack should upgrade from 2.6.1 to 3.0.0
yarn run webpack #again

What is the expected behavior?
The tree shaking should works like webpack@2.6.1.

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.
node@6.11.0
webpack@3.0.0

The issue affects this package react-hot-loader@3.0.0-beta.7 because the sourcemapped-stacktrace dependency is not removed in the production build.

@jakeNiemiec
Copy link

This also is a problem with builds by angular-cli imported via webpack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants