fix(v2): don't run terser in parallel for WSL (#1326)

* fix(v2): don't run terser in parallel for WSL

* nits

* Update base.js

* Update base.js
This commit is contained in:
Endilie Yacop Sucipto 2019-03-31 13:41:28 +07:00 committed by GitHub
parent 6fd9253328
commit c33e874e1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -10,6 +10,7 @@ const CSSExtractPlugin = require('mini-css-extract-plugin');
const rehypePrism = require('@mapbox/rehype-prism');
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
const isWsl = require('is-wsl');
const mdLoader = require.resolve('./loaders/markdown');
@ -189,7 +190,9 @@ module.exports = function createBaseConfig(props, isServer) {
config.optimization.minimizer([
new TerserPlugin({
cache: true,
parallel: true,
// We can't run in parallel for WSL due to upstream bug
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
parallel: !isWsl,
sourceMap: true,
terserOptions: {
ecma: 6,

View file

@ -50,6 +50,7 @@
"fs-extra": "^7.0.0",
"globby": "^9.1.0",
"html-webpack-plugin": "^3.2.0",
"is-wsl": "^1.1.0",
"loader-utils": "^1.1.0",
"lodash": "^4.17.11",
"mini-css-extract-plugin": "^0.4.1",