From 580ed5d9b00f452b1743c88cb950cbd341e891e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20N=2EO=2E=20N=C3=B8rgaard=20Henriksen?= Date: Tue, 8 Dec 2020 05:24:33 +0100 Subject: [PATCH] Update postcss packages (#10003) Co-authored-by: Ian Schmitz --- .../react-scripts/config/webpack.config.js | 36 ++++++++++--------- packages/react-scripts/package.json | 7 ++-- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/packages/react-scripts/config/webpack.config.js b/packages/react-scripts/config/webpack.config.js index 8133faa721c..1c8d7980fe1 100644 --- a/packages/react-scripts/config/webpack.config.js +++ b/packages/react-scripts/config/webpack.config.js @@ -125,23 +125,25 @@ module.exports = function (webpackEnv) { // package.json loader: require.resolve('postcss-loader'), options: { - // Necessary for external CSS imports to work - // https://github.com/facebook/create-react-app/issues/2677 - ident: 'postcss', - plugins: () => [ - require('postcss-flexbugs-fixes'), - require('postcss-preset-env')({ - autoprefixer: { - flexbox: 'no-2009', - }, - stage: 3, - }), - // Adds PostCSS Normalize as the reset css with default options, - // so that it honors browserslist config in package.json - // which in turn let's users customize the target behavior as per their needs. - postcssNormalize(), - ], - sourceMap: isEnvProduction ? shouldUseSourceMap : isEnvDevelopment, + postcssOptions: { + plugins: [ + require('postcss-flexbugs-fixes'), + [ + require('postcss-preset-env'), + { + autoprefixer: { + flexbox: 'no-2009', + }, + stage: 3, + }, + ], + // Adds PostCSS Normalize as the reset css with default options, + // so that it honors browserslist config in package.json + // which in turn let's users customize the target behavior as per their needs. + postcssNormalize(), + ], + }, + sourceMap: isEnvProduction && shouldUseSourceMap, }, }, ].filter(Boolean); diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 11e16017c9b..e049f2d8cba 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -65,9 +65,10 @@ "mini-css-extract-plugin": "0.11.3", "optimize-css-assets-webpack-plugin": "5.0.4", "pnp-webpack-plugin": "1.6.4", - "postcss-flexbugs-fixes": "4.2.1", - "postcss-loader": "3.0.0", - "postcss-normalize": "8.0.1", + "postcss": "8.1.14", + "postcss-flexbugs-fixes": "5.0.2", + "postcss-loader": "4.1.0", + "postcss-normalize": "9.0.0", "postcss-preset-env": "6.7.0", "postcss-safe-parser": "5.0.2", "prompts": "2.4.0",