Skip to content

Commit a9ac789

Browse files
pluscubedgaearon
authored andcommitted
Fix sourcemap directory organizing on Windows (#2456) (#2610)
* Fix sourcemap directory organizing on Windows * Update comments
1 parent 6a09ed1 commit a9ac789

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-scripts/config/webpack.config.dev.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ module.exports = {
7777
chunkFilename: 'static/js/[name].chunk.js',
7878
// This is the URL that app is served from. We use "/" in development.
7979
publicPath: publicPath,
80-
// Point sourcemap entries to original disk location
80+
// Point sourcemap entries to original disk location (format as URL on Windows)
8181
devtoolModuleFilenameTemplate: info =>
82-
path.resolve(info.absoluteResourcePath),
82+
path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
8383
},
8484
resolve: {
8585
// This allows you to set a fallback for where Webpack should look for modules.

packages/react-scripts/config/webpack.config.prod.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ module.exports = {
7575
chunkFilename: 'static/js/[name].[chunkhash:8].chunk.js',
7676
// We inferred the "public path" (such as / or /my-project) from homepage.
7777
publicPath: publicPath,
78-
// Point sourcemap entries to original disk location
78+
// Point sourcemap entries to original disk location (format as URL on Windows)
7979
devtoolModuleFilenameTemplate: info =>
80-
path.relative(paths.appSrc, info.absoluteResourcePath),
80+
path.relative(paths.appSrc, info.absoluteResourcePath).replace(/\\/g, '/'),
8181
},
8282
resolve: {
8383
// This allows you to set a fallback for where Webpack should look for modules.

0 commit comments

Comments
 (0)