未验证 提交 7ce000b3 编写于 作者: J Joe Haddad 提交者: GitHub

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
上级 5ed89d30
import isWslBoolean from 'next/dist/compiled/is-wsl'
import curry from 'next/dist/compiled/lodash.curry'
import { Configuration } from 'webpack'
import { ConfigurationContext } from '../utils'
const isWindows = process.platform === 'win32' || isWslBoolean
export const base = curry(function base(
ctx: ConfigurationContext,
config: Configuration
......@@ -19,7 +22,7 @@ export const base = curry(function base(
if (ctx.isDevelopment) {
if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {
config.devtool = false
} else if (process.platform === 'win32') {
} else if (isWindows) {
// Non-eval based source maps are slow to rebuild, so we only enable
// them for Windows. Unfortunately, eval source maps are flagged as
// suspicious by Windows Defender and block HMR.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册