Skip to content

Commit

Permalink
WSL should be considered Windows for HMR option (#14254)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Timer authored Jun 17, 2020
1 parent 5ed89d3 commit 7ce000b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/next/build/webpack/config/blocks/base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
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
Expand All @@ -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.
Expand Down

0 comments on commit 7ce000b

Please sign in to comment.