Skip to content

Commit 7ce000b

Browse files
authored
WSL should be considered Windows for HMR option (#14254)
This toggles the separate Windows `devtool` setting for WSL. We cannot test this as we do not have access to WSL in our current test setup suite, however, this is a temporary patch that should be fixed with the webpack 5 upgrade, so I do not feel strongly about testing it. --- Fixes #14253
1 parent 5ed89d3 commit 7ce000b

File tree

1 file changed

+4
-1
lines changed
  • packages/next/build/webpack/config/blocks

1 file changed

+4
-1
lines changed

packages/next/build/webpack/config/blocks/base.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import isWslBoolean from 'next/dist/compiled/is-wsl'
12
import curry from 'next/dist/compiled/lodash.curry'
23
import { Configuration } from 'webpack'
34
import { ConfigurationContext } from '../utils'
45

6+
const isWindows = process.platform === 'win32' || isWslBoolean
7+
58
export const base = curry(function base(
69
ctx: ConfigurationContext,
710
config: Configuration
@@ -19,7 +22,7 @@ export const base = curry(function base(
1922
if (ctx.isDevelopment) {
2023
if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {
2124
config.devtool = false
22-
} else if (process.platform === 'win32') {
25+
} else if (isWindows) {
2326
// Non-eval based source maps are slow to rebuild, so we only enable
2427
// them for Windows. Unfortunately, eval source maps are flagged as
2528
// suspicious by Windows Defender and block HMR.

0 commit comments

Comments
 (0)