webpack-concat-plugin
webpack-concat-plugin copied to clipboard
Generate Source Map with sourcesContent
Hi, in my case the sources of the concated files are outside the webroot. this causes that i can not follow the source file along in chrome when debugging. So afaik for this case, the source maps support the sourcesContent option (i found this https://stackoverflow.com/a/19803425)
currently i have
devtool: 'source-map'
and
new ConcatPlugin({ uglify: false, sourceMap: true, ...
Can someone please give me a hint / what to do? I am not shure how webpack-concat-plugin handles source map, so is it influences by devtools setting for other webpack source map plugins?
I want the bundle.js and bundle.map to end up in /Scripts/app
My setup looks like this
new ConcatPlugin({
uglify: true,
sourceMap: true,
outputPath: './',
fileName: 'bundle.js',
filesToConcat: [
'block-ui/jquery.blockUI.js',
'./Scripts/myCustomScript.js'
],
attributes: {
async: false
}
});
The result
I get the files correctly in /Scripts/app and the reason for this is because I have the following in my module exports
output: {
path: path.join(__dirname, 'Scripts', 'app'),
filename: '[name].bundle.min.js',
},
However my bundle.js.map contains the following
{"version":3,"sources":["\\node_modules\\block-ui\\jquery.blockUI.js", "\\Scripts\\myCustomScript.js" ...
So when I load a page in chrome it tries to load the original js files like so
http://localhost:55555/Scripts/app//node_modules/block-ui/jquery.blockUI.js
and
http://localhost:55555/Scripts/app//Scripts/myCustomScript.js
Where it of course should have been
http://localhost:55555/node_modules/block-ui/jquery.blockUI.js
and
http://localhost:55555/Scripts/myCustomScript.js
I am unsure how to get it cooperate