Skip to content

SourceMap is missing when UglifyJSPlugin is enabled #2704

@qingweibinary

Description

@qingweibinary

I'm submitting a bug report

Webpack version:
2.1.0-beta.4

Please tell us about your environment:
OSX 10.x

Current behavior:
Source map is not generated when new webpack.optimize.UglifyJsPlugin() is used.
If I remove UglifyJSPlugin or use webpack version 1.13, it does produce source map.

Expected/desired behavior:
Source map should be generated.

  • My config
const path = require('path');
const webpack = require('webpack');
const WebpackNotifierPlugin = require('webpack-notifier');
const styleLintPlugin = require('stylelint-webpack-plugin');

const env = process.env.NODE_ENV;

module.exports = {
    devtool: 'source-map',
    entry: './src',
    output: {
        path: path.join(__dirname, 'dist'),
        filename: 'app.js',
    },
    plugins: [
        new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify('production'),
            },
        }),
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.UglifyJsPlugin()
    ],
    module: {
        loaders: [
            { test: /\.js$/, exclude: /node_modules/, loader: 'babel' },
            { test: /\.js$/, exclude: /node_modules/, loader: 'eslint' },
            { test: /\.css$/, exclude: /node_modules/, loader: 'style!css?modules&importLoaders=1&localIdentName=[local]_[hash:base64:5]' },
        ],
    },
};

  • Language: [ES6/7]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions