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

Pin rollup version to fix tree shaking bugs #2572

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esinstall/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"picomatch": "^2.2.2",
"rimraf": "^3.0.0",
"slash": "^3.0.0",
"rollup": "^2.34.0",
"rollup": "2.37.1",
"rollup-plugin-polyfill-node": "^0.5.0",
"validate-npm-package-name": "^3.0.0",
"vm2": "^3.9.2"
Expand Down
1 change: 1 addition & 0 deletions test/esinstall/tree-shake-expression/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test-*
8 changes: 8 additions & 0 deletions test/esinstall/tree-shake-expression/inner-module/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

var wiggle = function wiggle() {

}.bind(this);

export default function() {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "inner-module",
"version": "1.0.0",
"main": "main.js"
}
7 changes: 7 additions & 0 deletions test/esinstall/tree-shake-expression/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "@snowpack/test-tree-shake-expression",
"version": "1.0.0",
"dependencies": {
"inner-module": "file:./inner-module"
}
}
20 changes: 20 additions & 0 deletions test/esinstall/tree-shake-expression/tree-shake-expression.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require('fs');
const path = require('path');
const {runTest} = require('../esinstall-test-utils.js');

const cwd = __dirname;

describe('tree shaking expressions', () => {
it('works', async () => {
const pkg = 'inner-module';
const dest = path.join(cwd, 'test-output');
await runTest([pkg], {cwd, dest});

const output = fs.readFileSync(path.join(dest, `${pkg}.js`), 'utf8');

expect(output).toEqual(
// left hand assignment not removed
expect.stringContaining(`var wiggle`)
);
});
});
10 changes: 10 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8222,6 +8222,9 @@ init-package-json@^1.10.3:
validate-npm-package-license "^3.0.1"
validate-npm-package-name "^3.0.0"

"inner-module@file:./test/esinstall/tree-shake-expression/inner-module":
version "1.0.0"

inquirer@^6.2.0:
version "6.5.2"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca"
Expand Down Expand Up @@ -12770,6 +12773,13 @@ rollup-pluginutils@^2.8.2:
dependencies:
estree-walker "^0.6.1"

[email protected]:
version "2.37.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.37.1.tgz#aa7aadffd75c80393f9314f9857e851b0ffd34e7"
integrity sha512-V3ojEeyGeSdrMSuhP3diBb06P+qV4gKQeanbDv+Qh/BZbhdZ7kHV0xAt8Yjk4GFshq/WjO7R4c7DFM20AwTFVQ==
optionalDependencies:
fsevents "~2.1.2"

rollup@^2.23.0, rollup@^2.34.0, rollup@^2.35.1:
version "2.36.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.36.1.tgz#2174f0c25c7b400d57b05628d0e732c7ae8d2178"
Expand Down