Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourcemaps aren't generated when minifying #24

Closed
anthonychung14 opened this issue May 22, 2017 · 3 comments
Closed

sourcemaps aren't generated when minifying #24

anthonychung14 opened this issue May 22, 2017 · 3 comments

Comments

@anthonychung14
Copy link

anthonychung14 commented May 22, 2017

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
Copy link

sgal commented Jun 26, 2017

@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
Copy link
Owner

@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
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants