Skip to content

Commit

Permalink
Define the library name so that devtools sourcemaps can have a proper…
Browse files Browse the repository at this point in the history
… namespace

https://webpack.js.org/configuration/output/#outputdevtoolnamespace

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Apr 16, 2021
1 parent 2f69869 commit f13804e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ module.exports = {
publicPath: '/js/',
filename: `${appName}-[name].js?v=[contenthash]`,
chunkFilename: `${appName}-[name].js?v=[contenthash]`,
// Make sure sourcemaps have a proper path and do not
// leak local paths https://github.com/webpack/webpack/issues/3603
devtoolNamespace: appName,
devtoolModuleFilenameTemplate(info) {
const rootDir = process.cwd()
const rel = path.relative(rootDir, info.absoluteResourcePath)
return `webpack:///${appName}/${rel}`
},
},

optimization: {
Expand Down

0 comments on commit f13804e

Please sign in to comment.