-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
v2: There's no bundling + tree shaking without minify-ing? #3459
Comments
As far as I know, the tree shaking only happens in minifying. In normal bundle, you can see the part of code has been marked as Technically it can be done. |
Exactly.
Yea, seen that. |
Yeah I confirm, tree shaking results can be seen during final build for production. import { fakeFunc } from './myModule'
console.log(fakeFunc) And you should get a warning from webpack inside the console |
You could also use |
Omg, seriously. I know it is wokring, that's not the case. The case is that I want tree-shaked bundles without minifying - intentionally.
What information? First it seems it does nothing for me, output is absolutely the same; Second don't want "information", I want real working bundle :D ~/code/foobar master ✓ ✗
% ❯ webpack --entry ./index.js --output-filename bundle.js --target node December 13, 16:58:04
Hash: 9567831ddc533348d9a4
Version: webpack 2.1.0-beta.27
Time: 307ms
Asset Size Chunks Chunk Names
bundle.js 29.7 kB 0 [emitted] null
[15] ./index.js 2.73 kB {0} [built]
+ 15 hidden modules
~/code/foobar master ✓ ✗
% ❯ webpack --entry ./index.js --output-filename bundle.js --target node --display-used-exports December 13, 16:58:38
Hash: 9567831ddc533348d9a4
Version: webpack 2.1.0-beta.27
Time: 303ms
Asset Size Chunks Chunk Names
bundle.js 29.7 kB 0 [emitted] null
[15] ./index.js 2.73 kB {0} [built]
+ 15 hidden modules
~/code/foobar master ✓ ✗
% ❯ |
I'd like to do the same. I search how uglify is configured in prod mode (or at least with the --optimize-minify option) and it seams to be all the default options only source-map is updated. |
As far as I understand last weeks.. There's no way to make a bundle that will have "tree shaking" enabled without the minifying? It not looks cool to me. I tried bundling without minifying and it seems it is not tree-shaked.
Or if it is possible, how? Some examples? I'm talking for v2.
The text was updated successfully, but these errors were encountered: