Cheap source maps do not work with UglifyJsPlugin

I’m submitting a bug report

Webpack version:
1.13.1

Please tell us about your environment:
OSX 10.11.5

Current behavior:
Source maps either error or generate empty files when using UglifyJsPlugin and cheap inside devtool

Expected/desired behavior:
cheap variants generate correct files when using UglifyJsPlugin

To Reproduce:

  1. Clone https://github.com/mrooding/webpack-babel-integration-example
  2. Change config to https://gist.github.com/wenbochang/b1561d4a4c20faa4f854ab28112ce8c5

This is what I get for different devtool options running webpack:

  1. source-map – works
  2. cheap-source-map – Error: Failed to parse SourceMap
  3. cheap-module-source-map – No error, but bundle.js is empty inside webpack://
  4. cheap-eval-module-source-map – No bundle.js.map file gets generated

Browser: Chrome 51

Language: ES6

Thanks in advance for your time!

Author: Fantashit

2 thoughts on “Cheap source maps do not work with UglifyJsPlugin

  1. We seem to have the opposite:

    1. source-map – Error: Failed to parse SourceMap
    2. cheap-source-map – works

    Webpack 1.13.1, Ubuntu, Chrome

  2. I can confirm that this bug happens in webpack@2.1.0-beta13.
    Steps to reproduce

    • Set devtool to 'source-map'
    • Add new webpack.optimize.UglifyJsPlugin() to the list of plugins
    • Bundle the project
    • No source maps generated
    • Remove the UglifyJsPlugin
    • Bundle the project
    • Source maps generated as expected

Comments are closed.