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

Upgrade size snapshot plugin #483

Merged
merged 1 commit into from
May 1, 2018
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"validate": "yarn lint && yarn typecheck",
"lint": "yarn eslint .",
"typecheck": "flow check",
"check-bundle-sizes": "cross-env SNAPSHOT=check yarn build:dist && yarn build:clean",
"check-bundle-sizes": "cross-env SNAPSHOT=match yarn build:dist && yarn build:clean",
"update-bundle-sizes": "yarn build:dist && yarn build:clean",
"build": "yarn build:clean && yarn build:dist && yarn build:flow",
"build:clean": "rimraf dist",
Expand Down Expand Up @@ -94,7 +94,7 @@
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-size-snapshot": "^0.3.1",
"rollup-plugin-size-snapshot": "^0.4.0",
"rollup-plugin-strip": "^1.1.1",
"rollup-plugin-uglify": "^3.0.0",
"styled-components": "^3.2.6"
Expand Down
10 changes: 5 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ const getBabelOptions = () => ({
runtimeHelpers: true,
});

const shouldCheckSnapshot = process.env.SNAPSHOT === 'check';
const matchSnapshot = process.env.SNAPSHOT === 'match';

export default [
// Universal module definition (UMD) build
// - including console.* statements
// - conditionally used to check snapshot size
// - conditionally used to match snapshot size
{
input,
output: {
Expand All @@ -43,7 +43,7 @@ export default [
resolve({ extensions }),
commonjs({ include: 'node_modules/**' }),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
sizeSnapshot({ updateSnapshot: !shouldCheckSnapshot }),
sizeSnapshot({ matchSnapshot }),
],
},
// Minified UMD build
Expand All @@ -64,7 +64,7 @@ export default [
resolve({ extensions }),
commonjs({ include: 'node_modules/**' }),
strip({ debugger: true }),
sizeSnapshot({ updateSnapshot: !shouldCheckSnapshot }),
sizeSnapshot({ matchSnapshot }),
uglify(),
],
},
Expand All @@ -90,7 +90,7 @@ export default [
plugins: [
resolve({ extensions }),
babel(getBabelOptions()),
sizeSnapshot({ updateSnapshot: !shouldCheckSnapshot }),
sizeSnapshot({ matchSnapshot }),
],
},
];
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7331,16 +7331,17 @@ rollup-plugin-replace@^2.0.0:
minimatch "^3.0.2"
rollup-pluginutils "^2.0.1"

rollup-plugin-size-snapshot@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.3.1.tgz#b963b0cd1c446e734888068e30c997625eb9ee0f"
rollup-plugin-size-snapshot@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.4.0.tgz#59cf69ceaae595d36f5bb60a702a58824a567e03"
dependencies:
bytes "^3.0.0"
chalk "^2.3.2"
fast-deep-equal "^1.1.0"
gzip-size "^4.1.0"
jest-diff "^22.4.0"
memory-fs "^0.4.1"
rollup-plugin-replace "^2.0.0"
uglify-es "^3.3.9"
webpack "^4.5.0"

Expand Down