Add bundlesize (#502)

* Configure bundlesize

* Update travis script

* Remove node modules cache

* Run bundlesize as after script

* Remove duplicate coverage check

* Remove test:size from test command
This commit is contained in:
Josh Johnson 2019-01-24 23:21:00 +00:00 committed by GitHub
parent d02cdffcdb
commit 6c3bad777d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 7 deletions

View file

@ -7,6 +7,6 @@ before_install:
install:
- npm install
script:
- npm run test:unit
- npm run coverage
- npm run test:e2e
- npm run test
after_script:
- npm run bundlesize

View file

@ -1,5 +1,5 @@
# Choices.js ![Build Status](https://travis-ci.org/jshjohnson/Choices.svg?branch=master) [![](https://data.jsdelivr.com/v1/package/npm/choices.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/choices.js) [![npm](https://img.shields.io/npm/v/choices.js.svg)](https://www.npmjs.com/package/choices.js) [![codebeat badge](https://codebeat.co/badges/55120150-5866-42d8-8010-6aaaff5d3fa1)](https://codebeat.co/projects/github-com-jshjohnson-choices-master)
A vanilla, lightweight (~20kb gzipped 🎉), configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency.
A vanilla, lightweight (~25kb gzipped 🎉), configurable select box/text input plugin. Similar to Select2 and Selectize but without the jQuery dependency.
[Demo](https://joshuajohnson.co.uk/Choices/)

View file

@ -9,12 +9,13 @@
"build": "npm run js:build && npm run css:build",
"lint": "eslint assets/**/*.js",
"coverage": "nyc npm run test:unit",
"bundlesize": "bundlesize",
"cypress:run": "$(npm bin)/cypress run",
"cypress:open": "$(npm bin)/cypress open",
"test": "run-p test:unit test:e2e",
"test:unit": "mocha --require ./config/jsdom.js --compilers js:babel-core/register \"./src/**/**/**/**/*.test.js\" --exit",
"test:unit:watch": "npm run test:unit -- --watch --inspect=5556",
"test:e2e": "run-p --race start cypress:run",
"test": "run-p test:unit test:e2e",
"js:watch": "NODE_ENV=development node server.js",
"js:build:minimised": "webpack --env.minimize --config webpack.config.prod.js",
"js:build:unminimised": "webpack --config webpack.config.prod.js",
@ -60,6 +61,7 @@
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"babel-preset-stage-2": "^6.24.1",
"bundlesize": "^0.17.1",
"chai": "^4.1.0",
"csso": "^1.8.2",
"cypress": "^3.1.4",
@ -77,7 +79,7 @@
"jsdom": "^11.5.1",
"mocha": "^3.4.2",
"node-sass": "^4.9.3",
"nodemon": "^1.9.1",
"nodemon": "^1.18.9",
"npm-run-all": "^4.1.3",
"nyc": "^11.0.3",
"opn": "^5.1.0",
@ -115,5 +117,11 @@
"exclude": [
"src/scripts/**/**/*.test.js"
]
}
},
"bundlesize": [
{
"path": "public/assets/scripts/choices.min.js",
"maxSize": "25 kB"
}
]
}