Skip to content

Commit

Permalink
Match size snapshot to fail on CI (acdlite#672)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored and istarkov committed May 16, 2018
1 parent 7a9e2d2 commit e3af116
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"lib/packages/recompose/dist/Recompose.umd.js": {
"bundled": 78789,
"minified": 29082,
"gzipped": 9356
"bundled": 85035,
"minified": 31377,
"gzipped": 10006
},
"lib/packages/recompose/dist/Recompose.min.js": {
"bundled": 75283,
"minified": 27833,
"gzipped": 8952
"bundled": 81529,
"minified": 30125,
"gzipped": 9618
},
"lib/packages/recompose/dist/Recompose.esm.js": {
"bundled": 31265,
"minified": 15642,
"gzipped": 3464,
"bundled": 31436,
"minified": 15712,
"gzipped": 3522,
"treeshaked": {
"rollup": 569,
"webpack": 1797
"rollup": 601,
"webpack": 1863
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"lint": "eslint scripts src",
"build:recompose": "cross-env PACKAGE_NAME=recompose rollup --config scripts/rollup.config.js",
"test": "jest && flow",
"test": "jest && flow check && cross-env SNAPSHOT=match npm run build:recompose",
"test:watch": "cross-env BABEL_ENV=cjs jest --watch",
"release": "node scripts/release.js",
"postinstall": "node scripts/installNestedPackageDeps.js",
Expand Down Expand Up @@ -77,7 +77,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.0",
"rollup-plugin-size-snapshot": "^0.4.1",
"rollup-plugin-uglify": "^3.0.0",
"rx": "^4.1.0",
"rxjs": "^5.0.0",
Expand Down
8 changes: 5 additions & 3 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const getBabelOptions = () => ({
runtimeHelpers: true,
})

const matchSnapshot = process.env.SNAPSHOT === 'match'

export default [
{
input,
Expand All @@ -41,7 +43,7 @@ export default [
babel(getBabelOptions()),
commonjs(),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
sizeSnapshot(),
sizeSnapshot({ matchSnapshot }),
],
},

Expand All @@ -61,7 +63,7 @@ export default [
babel(getBabelOptions()),
commonjs(),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
sizeSnapshot(),
sizeSnapshot({ matchSnapshot }),
uglify(),
],
},
Expand All @@ -83,6 +85,6 @@ export default [
format: 'es',
},
external: isExternal,
plugins: [babel(getBabelOptions()), sizeSnapshot()],
plugins: [babel(getBabelOptions()), sizeSnapshot({ matchSnapshot })],
},
]
7 changes: 4 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5504,16 +5504,17 @@ rollup-plugin-replace@^2.0.0:
minimatch "^3.0.2"
rollup-pluginutils "^2.0.1"

rollup-plugin-size-snapshot@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.3.0.tgz#ac6e892763828b1618e6545e0252bf9ef5c7c88d"
rollup-plugin-size-snapshot@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/rollup-plugin-size-snapshot/-/rollup-plugin-size-snapshot-0.4.1.tgz#3d384ea0abeaad86da0c519793ae998553da0925"
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

0 comments on commit e3af116

Please sign in to comment.