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

Add bundlesize. #24145

Merged
merged 2 commits into from
Oct 1, 2017
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ language: node_js
git:
depth: 3
node_js:
- "4"
- "6"
- "8"
before_install:
- if [[ `npm -v` != 5* ]]; then npm install -g npm@5; fi
Expand Down
2 changes: 1 addition & 1 deletion docs/4.0/getting-started/build-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Bootstrap uses [NPM scripts](https://docs.npmjs.com/misc/scripts) for its build

To use our build system and run our documentation locally, you'll need a copy of Bootstrap's source files and Node. Follow these steps and you should be ready to rock:

1. [Download and install Node](https://nodejs.org/download/), which we use to manage our dependencies.
1. [Download and install Node.js](https://nodejs.org/download/), which we use to manage our dependencies.
2. Navigate to the root `/bootstrap` directory and run `npm install` to install our local dependencies listed in [package.json]({{ site.repo }}/blob/v{{ site.current_version }}/package.json).
3. [Install Ruby][install-ruby], install [Bundler][gembundler] with `gem install bundler`, and finally run `bundle install`. This will install all Ruby dependencies, such as Jekyll and plugins.
- **Windows users:** Read [this guide](https://jekyllrb.com/docs/windows/) to get Jekyll up and running without problems.
Expand Down
2 changes: 1 addition & 1 deletion docs/4.0/getting-started/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Pull in Bootstrap's **source files** into nearly any project with some of the mo

### npm

Install Bootstrap in your Node powered apps with [the npm package](https://www.npmjs.com/package/bootstrap):
Install Bootstrap in your Node.js powered apps with [the npm package](https://www.npmjs.com/package/bootstrap):

{% highlight sh %}
npm install bootstrap@{{ site.current_version }}
Expand Down
2 changes: 1 addition & 1 deletion docs/4.0/getting-started/webpack.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ toc: true

## Installing Bootstrap

[Install bootstrap]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/#npm) as a node module using npm.
[Install bootstrap]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/download/#npm) as a Node.js module using npm.

## Importing JavaScript

Expand Down
165 changes: 165 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
],
"scripts": {
"bash": "bash",
"bundlesize": "bundlesize",
"css": "npm-run-all --parallel css-lint* css-compile* --sequential css-prefix* css-minify*",
"css-main": "npm-run-all --parallel css-lint css-compile --sequential css-prefix css-minify",
"css-docs": "npm-run-all --parallel css-lint-docs css-compile-docs --sequential css-prefix-docs css-minify-docs",
Expand Down Expand Up @@ -56,7 +57,7 @@
"release-version": "node build/change-version.js",
"release-zip": "cd dist/ && zip -r9 bootstrap-$npm_package_version-dist.zip * && shx mv bootstrap-$npm_package_version-dist.zip ..",
"dist": "npm-run-all --parallel css js",
"test": "npm-run-all dist --parallel js-test --sequential docs-compile docs-lint",
"test": "npm-run-all dist --parallel js-test --sequential docs-compile docs-lint bundlesize",
"watch": "npm-run-all --parallel watch-css watch-js",
"watch-css": "nodemon --ignore js/ --ignore dist/ -e scss -x \"npm run css\"",
"watch-js": "nodemon --ignore scss/ --ignore js/dist/ --ignore dist/ -e js -x \"npm-run-all --parallel js-compile-*\""
Expand Down Expand Up @@ -84,6 +85,7 @@
"babel-plugin-external-helpers": "^7.0.0-beta.0",
"babel-plugin-transform-es2015-modules-strip": "^0.1.1",
"babel-preset-env": "^2.0.0-beta.0",
"bundlesize": "^0.14.4",
"clean-css-cli": "^4.1.6",
"cross-env": "^5.0.5",
"eslint": "^4.2.0",
Expand All @@ -107,7 +109,7 @@
"workbox-build": "^2.0.1"
},
"engines": {
"node": ">=4"
"node": ">=6"
},
"files": [
".babelrc",
Expand All @@ -131,6 +133,28 @@
"Android >= 4.4",
"Opera >= 30"
],
"bundlesize": [
{
"path": "./dist/css/bootstrap*.css",
"maxSize": "25 kB"
},
{
"path": "./dist/js/bootstrap.bundle.js",
"maxSize": "50 kB"
},
{
"path": "./dist/js/bootstrap.bundle.min.js",
"maxSize": "25 kB"
},
{
"path": "./dist/js/bootstrap.js",
"maxSize": "20 kB"
},
{
"path": "./dist/js/bootstrap.min.js",
"maxSize": "15 kB"
}
],
"jspm": {
"registry": "npm",
"main": "js/bootstrap",
Expand Down