-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Sourcemap settings for UglifyJsPlugin in build #336
Conversation
…ld files, and minify css
Two quick notes. First, css files are already minified. We use css-loaders Thanks for bring this up! |
When I was using I agree that source maps are useful, the main issue was trying to fix was that they exposed the home directory.. But I am not sure anyway if sourcemap are supposed to be included in production? |
I'd maybe prefer to leave this as an option to pass rather than remove or keep them entirely. I personally like them in development (of course), but would prefer to remove them in production. |
Agree as well, this should be optional, but in build default behaviour maybe should be that css is minified and sourcemaps disabled. Do you have any thoughts on how this should be accomplice with |
It looks like this Webpack configuration lets us change how files are displayed in sourcemaps https://webpack.github.io/docs/configuration.html#output-devtoolmodulefilenametemplate also http://stackoverflow.com/questions/34185748/how-to-make-webpack-sourcemap-to-original-files So perhaps sourcemaps are on by default by instead of outputting an absolute path we output a path relative to the root directory of the site? Then in 1.0 it'll be far easier to expose configuration like adding an option to disable sourcemaps in production altogether. Thoughts? |
export function modifyWebpackConfig(config, env) {
if (env === 'build-javascript') {
config.merge({
devtool: 'hidden-source-map'
});
}
return config;
} This hides refs to source map in production build. You could choose from all the options that |
This is pretty ancient. Happy to restart the discussion with a new PR |
We need {sourceMap:false} for UglifyJsPlugin to avoid local path showing up below sources and webpack in google chrome inspector. This also minify css files.