Skip to content

fix(build): stop emitting each source map twice - #772

Open
cwillisf wants to merge 1 commit into
developfrom
fix/duplicate-sourcemap-emit
Open

cwillisf wants to merge 1 commit into
developfrom
fix/duplicate-sourcemap-emit

Conversation

@cwillisf

@cwillisf cwillisf commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Resolves

Proposed Changes

Turn off devtool in webpack.makeConfig.js and move its options (columns: false, module: true) onto the explicit SourceMapDevToolPlugin that the config already adds.

Reason for Changes

devtool: 'cheap-module-source-map' registers its own SourceMapDevToolPlugin, so each bundle's .map file was emitted twice with different content. webpack 5.107 let the second write win silently. 5.108+ reports it as Conflict: Multiple assets emit different content to the same filename main.js.map and fails the build, which is why the webpack update PR has been red since May.

Test Coverage

  • npm run compile succeeds on the pinned webpack 5.107.0 and on 5.111.1 (installed temporarily with --no-save).
  • Emitted maps still map to original sources: main.js.map and renderer.js.map list webpack:///./src/... entries with sourcesContent.
  • npm test (lint) is clean.

devtool: 'cheap-module-source-map' registers its own SourceMapDevToolPlugin,
and the config also adds one explicitly with filename '[file].map'. Both write
main.js.map (and every chunk's .map) with different content. webpack 5.107
let the second write win silently; 5.108+ reports it as an asset conflict and
fails the build, which is why every webpack update since has had red CI.

Turn off devtool and carry its options (line-only mappings to original module
source) onto the explicit plugin, so the emitted maps match what shipped.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant