Unverified Commit ace8963d authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Remove inline-source-map for Windows (#28893)



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes
parent 0baced3e
import isWslBoolean from 'next/dist/compiled/is-wsl'
import curry from 'next/dist/compiled/lodash.curry' import curry from 'next/dist/compiled/lodash.curry'
import { webpack, isWebpack5 } from 'next/dist/compiled/webpack/webpack' import { webpack, isWebpack5 } from 'next/dist/compiled/webpack/webpack'
import { ConfigurationContext } from '../utils' import { ConfigurationContext } from '../utils'
const isWindows = process.platform === 'win32' || isWslBoolean
export const base = curry(function base( export const base = curry(function base(
ctx: ConfigurationContext, ctx: ConfigurationContext,
config: webpack.Configuration config: webpack.Configuration
...@@ -27,11 +24,6 @@ export const base = curry(function base( ...@@ -27,11 +24,6 @@ export const base = curry(function base(
if (ctx.isDevelopment) { if (ctx.isDevelopment) {
if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) { if (process.env.__NEXT_TEST_MODE && !process.env.__NEXT_TEST_WITH_DEVTOOL) {
config.devtool = false config.devtool = false
} 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.
config.devtool = 'inline-source-map'
} else { } else {
// `eval-source-map` provides full-fidelity source maps for the // `eval-source-map` provides full-fidelity source maps for the
// original source, including columns and original variable names. // original source, including columns and original variable names.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment