From 2cff34cd4c928c7c352ed2335c7936bf901acf27 Mon Sep 17 00:00:00 2001 From: Dan Abramov <dan.abramov@gmail.com> Date: Fri, 5 Aug 2016 17:15:49 +0100 Subject: [PATCH] Clarify why we only need css?-autoprefixer in development Fixes #377 --- config/webpack.config.prod.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index dbac03f1a..2a3b1a818 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -116,7 +116,12 @@ module.exports = { include: [paths.appSrc, paths.appNodeModules], // "?-autoprefixer" disables autoprefixer in css-loader itself: // https://github.com/webpack/css-loader/issues/281 - // We already have it thanks to postcss. + // We already have it thanks to postcss. We only pass this flag in + // production because "css" loader only enables autoprefixer-powered + // removal of unnecessary prefixes when Uglify plugin is enabled. + // Webpack 1.x uses Uglify plugin as a signal to minify *all* the assets + // including CSS. This is confusing and will be removed in Webpack 2: + // https://github.com/webpack/webpack/issues/283 loader: ExtractTextPlugin.extract('style', 'css?-autoprefixer!postcss') // Note: this won't work without `new ExtractTextPlugin()` in `plugins`. }, -- GitLab