gdborton / webpack-parallel-uglify-plugin

A faster uglifyjs plugin.
466 stars 34 forks source link

sourcemaps aren't generated when minifying #24

Closed anthonychung14 closed 7 years ago

anthonychung14 commented 7 years ago

without minifying the build, webpack generates sourcemaps correctly.

upon minifying the build with your plugin:

exports.minify = function (path) {
    return {
        plugins: [
            new ParallelUglifyPlugin({
                cacheDir: path + '/cache/'
            })
        ]
    };
};
config = merge(
            config,
            {
                devtool: 'source-map',
                output: {
                    path: PATHS.build,
                    filename: '[name].js',
                    sourceMapFilename: '[name].js.map'
                },
            },
            parts.setupLess([PATHS.app]),
            parts.setFreeVariable(
                'process.env.NODE_ENV',
                'production'
            ),
            parts.minify(PATHS.build)
        );
  1. webpack doesn't output a sourceMap file
  2. the //# sourceMappingUrl=app.js.map is missing from file output

we'd really love to use your parallelized version, but without being able to generate sourcemaps in production, we cannot! :(

sgal commented 7 years ago

@anthonychung14 Which version of webpack are you using? If it's webpack 2 (or 3), then you need to pass the sourceMap: true to uglilfy plugin, since it is defaulting to false in webpack 2. Check migration from webpack 1 to webpack 2

gdborton commented 7 years ago

@anthonychung14 With the current version, as long as the devtool option is set, you should be seeing source maps. With the next major release I'm adding an explicit option that will need to be set for source map support.

Are you still seeing issues with this?

gdborton commented 7 years ago

@anthonychung14 The newest release 1.0.0 uses a sourceMap boolean option to determine whether or not to build source maps. I'm closing this issue out as I think it's been addressed. Please open a new issue if you're still having trouble.