Skip to content

Commit 3e336d9

Browse files
endilieyJack Zhao
authored andcommitted
fix: terser-webpack-plugin hanging on WSL (#6732)
* fix: terser-webpack-plugin hanging on WSL * nits * Merge branch 'master' into terser-parallel-bug-wsl Co-authored-by: Jack Zhao <[email protected]>
1 parent ac15fae commit 3e336d9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Diff for: packages/react-scripts/config/webpack.config.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
'use strict';
1010

1111
const fs = require('fs');
12+
const isWsl = require('is-wsl');
1213
const path = require('path');
1314
const webpack = require('webpack');
1415
const resolve = require('resolve');
@@ -222,7 +223,9 @@ module.exports = function(webpackEnv) {
222223
},
223224
// Use multi-process parallel running to improve the build speed
224225
// Default number of concurrent runs: os.cpus().length - 1
225-
parallel: true,
226+
// Disabled on WSL (Windows Subsystem for Linux) due to an issue with Terser
227+
// https://github.com/webpack-contrib/terser-webpack-plugin/issues/21
228+
parallel: !isWsl,
226229
// Enable file caching
227230
cache: true,
228231
sourceMap: shouldUseSourceMap,

Diff for: packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"fs-extra": "7.0.1",
5050
"html-webpack-plugin": "4.0.0-beta.5",
5151
"identity-obj-proxy": "3.0.0",
52+
"is-wsl": "^1.1.0",
5253
"jest": "24.7.1",
5354
"jest-environment-jsdom-fourteen": "0.1.0",
5455
"jest-resolve": "24.7.1",

0 commit comments

Comments
 (0)