Skip to content

Commit

Permalink
config.webpack: Add devtoolModuleFilenameTemplate (#119)
Browse files Browse the repository at this point in the history
Point sourcemap entries to original disk location (format as URL on Windows)
  • Loading branch information
artembatura authored Feb 6, 2019
1 parent c2c92cc commit 807ead9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/config.webpack/src/createWebpackConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ export const createWebpackConfiguration = ({
filename: isDev ? 'js/[name].js' : 'js/[name].[contenthash:8].js',
chunkFilename: isDev
? 'js/[name].chunk.js'
: 'js/[name].[contenthash:8].chunk.js'
: 'js/[name].[contenthash:8].chunk.js',
devtoolModuleFilenameTemplate: !isDev
? info =>
path
.relative(paths.src, info.absoluteResourcePath)
.replace(/\\/g, '/')
: info => path.resolve(info.absoluteResourcePath).replace(/\\/g, '/')
},
bail: !isDev,
optimization: {
Expand Down

0 comments on commit 807ead9

Please sign in to comment.