We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried the math example from the 1.9.0 blog post to see if tree shaking worked. It doesn't seem to do anything for me.
math
No babel configuration.
Ran parcel with ./node_modules/.bin/parcel build --experimental-scope-hoisting index.js
./node_modules/.bin/parcel build --experimental-scope-hoisting index.js
Generate code without the sub function.
sub
The sub function is there
(function () {function a(r,$){return r+$}function b(r,$){return r-$}a,b;console.log(a(2,3));})();
Straight from the blog post:
// index.js import { add } from "./math"; console.log(add(2, 3));
// math.js export function add(a, b) { return a+ b; } export function sub(a, b) { return a - b; }
The text was updated successfully, but these errors were encountered:
This seems to be a minimal example where treeshaking works correctly only with --no-minify actually (as in #2297):
--no-minify
(function() { // ASSET: math.js // math.js function $RK1r$export$add(a, b) { return a + b; } console.log($RK1r$export$add(2, 3)); })();
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
🐛 bug report
I tried the
math
example from the 1.9.0 blog post to see if tree shaking worked. It doesn't seem to do anything for me.🎛 Configuration (.babelrc, package.json, cli command)
No babel configuration.
Ran parcel with
./node_modules/.bin/parcel build --experimental-scope-hoisting index.js
🤔 Expected Behavior
Generate code without the
sub
function.😯 Current Behavior
The
sub
function is there(function () {function a(r,$){return r+$}function b(r,$){return r-$}a,b;console.log(a(2,3));})();
💻 Code Sample
Straight from the blog post:
🌍 Your Environment
The text was updated successfully, but these errors were encountered: