0

I tried excluding source maps in the assets list with no luck

Here's what I tried

devtool: 'source-map',
stats: {
  excludeAssets: /\.map$/
}

But it's still showing the source maps

Version: webpack 2.7.0
       Asset     Size    Chunks             Chunk Names
file1.js.map     117 kB       3  [emitted]  common
   file1.css     110 kB       1  [emitted]  main_css
unloco
  • 6,928
  • 2
  • 47
  • 58

1 Answers1

2

Don't include devtool: 'source-map' if you don't want sourcemaps. If you want to conditionally add sourcemaps you can do something like

{ devtool : ENABLE_SOURCEMAPS ? 'source-map' : 'none'}

Where ENABLE_SOURCEMAP is a variable you define in your file that can be true or false.

jsilvax
  • 89
  • 1
  • 6
  • It wasn't supported on 2.7.1, I just has to upgrade my webpack version https://github.com/webpack/webpack/pull/5377#issuecomment-345789493 – unloco Nov 20 '17 at 21:23