8000 Add bundle size check using bundlewatch (#157) · cloudinary/cloudinary-react@8414706 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8414706

Browse files
author
Nir Maoz
authored
Add bundle size check using bundlewatch (#157)
1 parent 8166e70 commit 8414706

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ node_js:
44
- "node"
55
- "lts/*"
66
before_script:
7-
- npm run compile
8-
- npm run dist
7+
- npm run build
98
env:
109
- TEST_SUBJECT=src
1110
- TEST_SUBJECT=lib

bundlewatch.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const bundlewatchConfig = {
2+
files: [
3+
{
4+
path: './dist/cloudinary-react.js',
5+
maxSize: '41kb'
6+
}
7+
],
8+
defaultCompression: 'gzip',
9+
};
10+
11+
module.exports = bundlewatchConfig;

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"test:all": "run-s compile dist test test-dist test-lib",
99
"test-dist": "TEST_SUBJECT=dist node_modules/.bin/mocha --require @babel/register test/.setup.js --recursive test",
1010
"test-lib": "TEST_SUBJECT=lib node_modules/.bin/mocha --require @babel/register test/.setup.js --recursive test",
11-
"compile": "node_modules/.bin/babel src --out-dir lib --copy-files ",
12-
"dist": "node_modules/.bin/webpack && npm run build-storybook",
11+
"prebuild": "node_modules/.bin/babel src --out-dir lib --copy-files ",
12+
"build": "node_modules/.bin/webpack && npm run build-storybook && npm run bundlewatch",
13+
"bundlewatch": "bundlewatch --config ./bundlewatch.config.js",
1314
"storybook": "start-storybook -p 6006",
1415
"build-storybook": "del-cli docs && build-storyb 6D4D ook -c .storybook -o docs"
1516
},
@@ -39,6 +40,7 @@
3940
"babelify": "^10.0.0",
4041
"browserify": "^16.2.3",
4142
"browserify-shim": "^3.8.14",
43+
"bundlewatch": "^0.2.6",
4244
"chai": "^4.1.2",
4345
"chai-string": "^1.4.0",
4446
"del-cli": "^3.0.0",

0 commit comments

Comments
 (0)
0