Skip to content

Commit

Permalink
fix(cli): update webpack plugin options
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVandivier committed Aug 31, 2022
1 parent 3677071 commit d084b44
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions cli/src/lib/plugin/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,29 @@ module.exports = ({ env: webpackEnv, paths }) => {
// 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,
}),
],
sourceMap: true,
postcssOptions: {
// Necessary for external CSS imports to work
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
config: false,
plugins: [
'postcss-flexbugs-fixes',
[
'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.
'postcss-normalize',
],
},
sourceMap: isDevelopment,
},
},
].filter(Boolean)
Expand Down Expand Up @@ -166,7 +176,10 @@ module.exports = ({ env: webpackEnv, paths }) => {
NODE_ENV: JSON.stringify(webpackEnv),
},
}),
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/locale$/,
contextRegExp: /moment$/,
}),
].filter(Boolean),
module: {
rules: [
Expand Down

0 comments on commit d084b44

Please sign in to comment.