Created
May 27, 2020 20:29
-
-
Save c10r/4153af6658c99b5101033491ace867f7 to your computer and use it in GitHub Desktop.
Add purgeCSS to the list of style loaders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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, | |
}), | |
postcssNormalize(), | |
purgecss, // <---- THIS PART IS NEW | |
], | |
sourceMap: isEnvProduction && shouldUseSourceMap, | |
}, | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment