I'm using webpack 3.12 and I do codesplitting on my js into chunks and use query strings to version them e.g. page1.chunk.js?id=abcdef. The file is then saved as page1.chunk.js. Problem is, the query string is applied to the source map names page1.chunk.js.map?id=abcdef and that is the name used when uploading to Bugsnag, this results is Bugsnag not matching the file page1.chunk.js to the map page1.chunk.js.map?id=abcdef. This is my webpack config that generates chunks names
I've come across issue #8 and saw the proposal to have a config option to determine the minifiedUrl. Is it possible to have something similar for the sourceMap option like so
new BugsnagSourceMapUploaderPlugin({
apiKey: 'YOUR_API_KEY',
appVersion: '1.2.3',
getSourceMap: (sourceMapName) => {
// this will remove the query string from the sourcemap name
return sourceMapName.replace(/\?id=.*/, '')
}
})
This would enable me to get rid of the query string in the sourcemap name so that Bugsnag can match the file and the map correctly.
I've looked into source-map-uploader-plugin.js and seen that there a function used to strip query strings from sourcemap
const outputSourceMapLocation = stripQuery(compiler.outputFileSystem.join(outputPath, map))
// ...
// removes a querystring from a file path
const stripQuery = file => {
const queryStringIdx = file.indexOf('?')
if (queryStringIdx < 0) return file
return file.substr(0, queryStringIdx)
}
But the query strings are still being included in the source map during upload.
I'm using webpack 3.12 and I do codesplitting on my js into chunks and use query strings to version them e.g.
page1.chunk.js?id=abcdef
. The file is then saved aspage1.chunk.js
. Problem is, the query string is applied to the source map namespage1.chunk.js.map?id=abcdef
and that is the name used when uploading to Bugsnag, this results is Bugsnag not matching the filepage1.chunk.js
to the mappage1.chunk.js.map?id=abcdef
. This is my webpack config that generates chunks namesI've come across issue #8 and saw the proposal to have a config option to determine the minifiedUrl. Is it possible to have something similar for the sourceMap option like so
This would enable me to get rid of the query string in the sourcemap name so that Bugsnag can match the file and the map correctly.
I've looked into source-map-uploader-plugin.js and seen that there a function used to strip query strings from sourcemap
But the query strings are still being included in the source map during upload.