Skip to content

Instantly share code, notes, and snippets.

@laggingreflex
Created July 30, 2016 23:44
Show Gist options
  • Save laggingreflex/c6ae56c0a7edffa0a230ce4b46557742 to your computer and use it in GitHub Desktop.
Save laggingreflex/c6ae56c0a7edffa0a230ce4b46557742 to your computer and use it in GitHub Desktop.
UglifyJsPlugin is preventing generation of sourcemaps in Webpack 2

Install & run:

npm i webpack@2.1.0-beta.20
./node_modules/.bin/webpack

Output with UglifyJsPlugin

           Asset     Size  Chunks             Chunk Names
    index.min.js  2.59 kB       0  [emitted]  main

Output without UglifyJsPlugin

           Asset     Size  Chunks             Chunk Names
    index.min.js  2.59 kB       0  [emitted]  main
index.min.js.map  2.54 kB       0  [emitted]  main

UglifyJsPlugin is preventing generation of sourcemaps in Webpack 2

var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: 'source-map',
entry: './index.js',
output: {
filename: 'index.min.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin()
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment