Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I place webpack source maps and source code files in seprate folders?

I read this question source maps files in production - is it safe?. I want to generate source map files in different folders with source code. Is there any way to do this with webpack? I also read this thread Relative SourceMap paths for debugging in WebStorm and tested but failed again.

like image 685
frankxu0203 Avatar asked Dec 01 '22 11:12

frankxu0203


1 Answers

You can use output.sourceMapFilename like so:

output: {
    filename: "bundles/[name].[chunkhash].min.js",
    sourceMapFilename: 'maps/[name].[chunkhash].map.js'
},

and then serve only from the bundles folder.

like image 140
Ivan Avatar answered Apr 30 '23 04:04

Ivan