Skip to content

Commit

Permalink
Add size-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
developit committed Dec 6, 2018
1 parent 0464766 commit c21f4e2
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 3 deletions.
193 changes: 193 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "superstatic build -p ${PORT:-8080} --host 0.0.0.0 --gzip -c '{\"rewrites\": [{\"source\":\"**\",\"destination\":\"index.html\"}],\"headers\":[{\"source\":\"**\",\"headers\":[{\"key\":\"Cache-Control\",\"value\":\"max-age=86400\"}]}]}'",
"prestart": "npm run build",
"build": "cross-env NODE_ENV=production webpack",
"prebuild": "npm run -s protect && rm -rf build && mkdir -p build",
"prebuild": "npm run -s protect && rm -rf build/assets build/content && mkdir -p build",
"test": "npm run -s lint && npm run -s test:karma",
"test:karma": "karma start test/karma.conf.js --single-run",
"protect": "[ \"$NODE_ENV\" = \"production\" ] && snyk protect || exit 0",
Expand Down Expand Up @@ -73,6 +73,7 @@
"recursive-readdir-sync": "^1.0.6",
"sinon": "^1.17.3",
"sinon-chai": "^2.8.0",
"size-plugin": "^1.1.0",
"source-map-loader": "^0.1.5",
"style-loader": "^0.13.1",
"superstatic": "^4.0.3",
Expand Down
20 changes: 18 additions & 2 deletions webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import HtmlWebpackPlugin from 'html-webpack-plugin';
import ProgressBarPlugin from 'progress-bar-webpack-plugin';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import OfflinePlugin from 'offline-plugin';
import SizePlugin from 'size-plugin';
import autoprefixer from 'autoprefixer';
import rreaddir from 'recursive-readdir-sync';
import minimatch from 'minimatch';
Expand Down Expand Up @@ -101,8 +102,11 @@ module.exports = {
],

plugins: ([
new ProgressBarPlugin(),
new ProgressBarPlugin({
clear: true
}),
new webpack.NoErrorsPlugin(),
new SizePlugin(),
new ExtractTextPlugin('style.css', {
allChunks: false,
disable: ENV!=='production'
Expand Down Expand Up @@ -176,7 +180,19 @@ module.exports = {
})
] : []),

stats: false,
stats: {
hash: false,
version: false,
timings: false,
assets: false,
chunks: false,
modules: false,
hiddenModules: false,
reasons: false,
children: false,
source: false,
publicPath: false
},

node: {
process: false,
Expand Down

0 comments on commit c21f4e2

Please sign in to comment.