aboutsummaryrefslogtreecommitdiff
path: root/webpack.config.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-05-08 01:32:33 +0200
committerFlorian Dold <florian.dold@gmail.com>2019-05-08 01:32:33 +0200
commit3db38fbd0b84d066d64f9b637f1efcc35ebf8ce3 (patch)
treec02425d7ce8f0075e2effe676103d589a0f1b574 /webpack.config.js
parent799fe2cc36ec6099ebac08e6f53963d2eb0d3407 (diff)
downloadwallet-core-3db38fbd0b84d066d64f9b637f1efcc35ebf8ce3.tar.xz
restore webpack splitting behavior
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/webpack.config.js b/webpack.config.js
index f0c2a16ce..68e8b3cac 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -2,6 +2,7 @@ const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const { CheckerPlugin } = require('awesome-typescript-loader')
+const TerserPlugin = require('terser-webpack-plugin');
function externalsCb(context, request, callback) {
@@ -17,7 +18,7 @@ module.exports = function (env) {
const base = {
output: {
filename: '[name]-bundle.js',
- chunkFilename: "[id].chunk.js",
+ chunkFilename: "[id]-bundle.js",
path: path.resolve(__dirname, "dist"),
},
module: {
@@ -43,6 +44,18 @@ module.exports = function (env) {
externalsCb,
"child_process",
],
+ optimization: {
+ minimize: false,
+ minimizer: [
+ new TerserPlugin({
+ sourceMap: true,
+ terserOptions: {
+ keep_classnames: true,
+ keep_fnames: true,
+ }
+ }),
+ ],
+ }
}
const configWebWorker = {
entry: {"cryptoWorker": "./src/crypto/cryptoWorker.ts"},
@@ -81,9 +94,14 @@ module.exports = function (env) {
name: "pages",
optimization: {
splitChunks: {
- name: "page-common",
- minChunks: 2,
- }
+ cacheGroups: {
+ commons: {
+ name: 'page-common',
+ chunks: 'all',
+ minChunks: 2,
+ },
+ },
+ },
},
};