diff --git a/.travis.yml b/.travis.yml index c1c3b37..505b583 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ node_js: - "node" - "lts/*" before_script: - - npm run compile - - npm run dist + - npm run build env: - TEST_SUBJECT=src - TEST_SUBJECT=lib diff --git a/bundlewatch.config.js b/bundlewatch.config.js new file mode 100644 index 0000000..3c54b68 --- /dev/null +++ b/bundlewatch.config.js @@ -0,0 +1,11 @@ +const bundlewatchConfig = { + files: [ + { + path: './dist/cloudinary-react.js', + maxSize: '41kb' + } + ], + defaultCompression: 'gzip', +}; + +module.exports = bundlewatchConfig; \ No newline at end of file diff --git a/package.json b/package.json index 7acd422..88e308a 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,9 @@ "test:all": "run-s compile dist test test-dist test-lib", "test-dist": "TEST_SUBJECT=dist node_modules/.bin/mocha --require @babel/register test/.setup.js --recursive test", "test-lib": "TEST_SUBJECT=lib node_modules/.bin/mocha --require @babel/register test/.setup.js --recursive test", - "compile": "node_modules/.bin/babel src --out-dir lib --copy-files ", - "dist": "node_modules/.bin/webpack && npm run build-storybook", + "prebuild": "node_modules/.bin/babel src --out-dir lib --copy-files ", + "build": "node_modules/.bin/webpack && npm run build-storybook && npm run bundlewatch", + "bundlewatch": "bundlewatch --config ./bundlewatch.config.js", "storybook": "start-storybook -p 6006", "build-storybook": "del-cli docs && build-storybook -c .storybook -o docs" }, @@ -39,6 +40,7 @@ "babelify": "^10.0.0", "browserify": "^16.2.3", "browserify-shim": "^3.8.14", + "bundlewatch": "^0.2.6", "chai": "^4.1.2", "chai-string": "^1.4.0", "del-cli": "^3.0.0",