@@ -34,7 +34,6 @@ const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin'
34
34
// @remove -on-eject-begin
35
35
const getCacheIdentifier = require ( 'react-dev-utils/getCacheIdentifier' ) ;
36
36
// @remove -on-eject-end
37
- const postcssNormalize = require ( 'postcss-normalize' ) ;
38
37
const createEnvironmentHash = require ( './webpack/persistentCache/createEnvironmentHash' ) ;
39
38
40
39
// Source maps are resource heavy and can cause out of memory issue for large source files.
@@ -124,22 +123,27 @@ module.exports = function (webpackEnv) {
124
123
// package.json
125
124
loader : require . resolve ( 'postcss-loader' ) ,
126
125
options : {
127
- // Necessary for external CSS imports to work
128
- // https://github.com/facebook/create-react-app/issues/2677
129
- ident : 'postcss' ,
130
- plugins : ( ) => [
131
- require ( 'postcss-flexbugs-fixes' ) ,
132
- require ( 'postcss-preset-env' ) ( {
133
- autoprefixer : {
134
- flexbox : 'no-2009' ,
135
- } ,
136
- stage : 3 ,
137
- } ) ,
138
- // Adds PostCSS Normalize as the reset css with default options,
139
- // so that it honors browserslist config in package.json
140
- // which in turn let's users customize the target behavior as per their needs.
141
- postcssNormalize ( ) ,
142
- ] ,
126
+ postcssOptions : {
127
+ // Necessary for external CSS imports to work
128
+ // https://github.com/facebook/create-react-app/issues/2677
129
+ ident : 'postcss' ,
130
+ plugins : [
131
+ 'postcss-flexbugs-fixes' ,
132
+ [
133
+ 'postcss-preset-env' ,
134
+ {
135
+ autoprefixer : {
136
+ flexbox : 'no-2009' ,
137
+ } ,
138
+ stage : 3 ,
139
+ } ,
140
+ ] ,
141
+ // Adds PostCSS Normalize as the reset css with default options,
142
+ // so that it honors browserslist config in package.json
143
+ // which in turn let's users customize the target behavior as per their needs.
144
+ 'postcss-normalize' ,
145
+ ] ,
146
+ } ,
143
147
sourceMap : isEnvProduction ? shouldUseSourceMap : isEnvDevelopment ,
144
148
} ,
145
149
} ,
0 commit comments