From 8347479f5d801b6b9756e804b62e04e517fed196 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Fri, 15 Mar 2019 23:05:31 +0900 Subject: Bump webpacker from 3.5.5 to 4.0.2 (#10277) Bumps [webpacker](https://github.com/rails/webpacker) from 3.5.5 to 4.0.2. - [Release notes](https://github.com/rails/webpacker/releases) - [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md) - [Commits](https://github.com/rails/webpacker/compare/v3.5.5...v4.0.2) Signed-off-by: dependabot[bot] Co-authored-by: Yamagishi Kazutoshi --- config/webpack/production.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'config/webpack/production.js') diff --git a/config/webpack/production.js b/config/webpack/production.js index d37e11792..cae978fcb 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -1,15 +1,15 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect +const path = require('path'); +const { URL } = require('url'); const merge = require('webpack-merge'); +const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); +const OfflinePlugin = require('offline-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const CompressionPlugin = require('compression-webpack-plugin'); const zopfli = require('@gfx/zopfli'); -const sharedConfig = require('./shared.js'); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; -const OfflinePlugin = require('offline-plugin'); -const { publicPath } = require('./configuration.js'); -const path = require('path'); -const { URL } = require('url'); +const { output } = require('./configuration'); +const sharedConfig = require('./shared'); let attachmentHost; @@ -28,15 +28,9 @@ if (process.env.S3_ENABLED === 'true') { module.exports = merge(sharedConfig, { mode: 'production', - - output: { - filename: '[name]-[chunkhash].js', - chunkFilename: '[name]-[chunkhash].js', - }, - - devtool: 'source-map', // separate sourcemap file, suitable for production + devtool: 'source-map', stats: 'normal', - + bail: true, optimization: { minimize: true, minimizer: [ @@ -60,10 +54,12 @@ module.exports = merge(sharedConfig, { plugins: [ new CompressionPlugin({ + filename: '[path].gz[query]', algorithm(input, compressionOptions, callback) { return zopfli.gzip(input, compressionOptions, callback); }, - test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/, + cache: true, + test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/, }), new BundleAnalyzerPlugin({ // generates report.html and stats.json analyzerMode: 'static', @@ -76,7 +72,7 @@ module.exports = merge(sharedConfig, { logLevel: 'silent', // do not bother Webpacker, who runs with --json and parses stdout }), new OfflinePlugin({ - publicPath: publicPath, // sw.js must be served from the root to avoid scope issues + publicPath: output.publicPath, // sw.js must be served from the root to avoid scope issues caches: { main: [':rest:'], additional: [':externals:'], -- cgit From 8da5b8e6695e3bcca8eb4bca754faef83a6656eb Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Fri, 15 Mar 2019 20:02:30 -0700 Subject: perf: remove zopfli to speed up webpack (#10288) --- config/webpack/production.js | 4 ---- package.json | 1 - yarn.lock | 9 +-------- 3 files changed, 1 insertion(+), 13 deletions(-) (limited to 'config/webpack/production.js') diff --git a/config/webpack/production.js b/config/webpack/production.js index cae978fcb..6f27aa2c7 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -7,7 +7,6 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); const OfflinePlugin = require('offline-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); const CompressionPlugin = require('compression-webpack-plugin'); -const zopfli = require('@gfx/zopfli'); const { output } = require('./configuration'); const sharedConfig = require('./shared'); @@ -55,9 +54,6 @@ module.exports = merge(sharedConfig, { plugins: [ new CompressionPlugin({ filename: '[path].gz[query]', - algorithm(input, compressionOptions, callback) { - return zopfli.gzip(input, compressionOptions, callback); - }, cache: true, test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/, }), diff --git a/package.json b/package.json index 79240df07..63cfa25b8 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,6 @@ "@babel/preset-env": "^7.3.4", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.3.4", - "@gfx/zopfli": "^1.0.11", "array-includes": "^3.0.3", "autoprefixer": "^9.4.10", "axios": "^0.18.0", diff --git a/yarn.lock b/yarn.lock index 47bbafc87..9d7f0eccb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -846,13 +846,6 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.2.tgz#63985d3d8b02530e0869962f4da09142ee8e200e" integrity sha512-n/VQ4mbfr81aqkx/XmVicOLjviMuy02eenSdJY33SVA7S2J42EU0P1H0mOogfYedb3wXA0d/LVtBrgTSm04WEA== -"@gfx/zopfli@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@gfx/zopfli/-/zopfli-1.0.11.tgz#6ced06b4566a5feb0036fe6a1e0262ce6cb1d6c5" - integrity sha512-wW+hi+bqdYCpBIvL8g7RYub9YXf5crhZK9SNk/VZmbF177Em1VwFv488qyh8iBpCo6GptcP1Zam0bJfY3VmMbg== - dependencies: - base64-js "^1.3.0" - "@jest/console@^24.3.0": version "24.3.0" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.3.0.tgz#7bd920d250988ba0bf1352c4493a48e1cb97671e" @@ -1690,7 +1683,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2, base64-js@^1.3.0: +base64-js@^1.0.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== -- cgit From d5c79975ea13bfc061d08cc123ffc25fb589e3ba Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 16 Mar 2019 03:23:54 -0700 Subject: perf: remove stats.json generation in webpack (#10290) * perf: remove stats.json generation in webpack * fix code comment --- config/webpack/production.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'config/webpack/production.js') diff --git a/config/webpack/production.js b/config/webpack/production.js index 6f27aa2c7..c829ff6f1 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -57,13 +57,8 @@ module.exports = merge(sharedConfig, { cache: true, test: /\.(js|css|html|json|ico|svg|eot|otf|ttf|map)$/, }), - new BundleAnalyzerPlugin({ // generates report.html and stats.json + new BundleAnalyzerPlugin({ // generates report.html analyzerMode: 'static', - generateStatsFile: true, - statsOptions: { - // allows usage with http://chrisbateman.github.io/webpack-visualizer/ - chunkModules: true, - }, openAnalyzer: false, logLevel: 'silent', // do not bother Webpacker, who runs with --json and parses stdout }), -- cgit