unloco
unloco

Reputation: 7320

Webpack: exclude source-maps from assets list

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

Upvotes: 0

Views: 2995

Answers (1)

jsilvax
jsilvax

Reputation: 97

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.

Upvotes: 2

Related Questions