Skip to content

Commit

Permalink
fix: postcss configuration file
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Nov 26, 2020
1 parent 820017e commit ef0fd04
Show file tree
Hide file tree
Showing 3 changed files with 3,487 additions and 342 deletions.
2 changes: 1 addition & 1 deletion core/webpack-configs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"less": "^3.12.2",
"less-loader": "^7.0.2",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"postcss-loader": "^4.0.4",
"postcss-loader": "^4.1.0",
"raw-loader": "^4.0.1",
"sass": "^1.27.0",
"sass-loader": "^10.0.4",
Expand Down
13 changes: 8 additions & 5 deletions core/webpack-configs/src/react/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ export const react: PresetType = (options: BuildProps) => {
const postcssOptions = customLoaderOptions(options, 'postcss-loader', {});
const postCssOptionsFile = findUpFile(process.cwd(), 'postcss.config.js');
const hasPostCss = Object.keys(postcssOptions).length || postCssOptionsFile;
if (hasPostCss) {
if (hasPostCss && !((postcssOptions as any).disable === true)) {
cssLoaders.push({
loader: 'postcss-loader',
options:
typeof postCssOptionsFile === 'string'
? require(postCssOptionsFile)
: { sourceMap: true },
options: {
postcssOptions:
typeof postCssOptionsFile === 'string'
? require(postCssOptionsFile)
: undefined,
sourceMap: true,
},
});
}
const result: PresetType = {
Expand Down
Loading

0 comments on commit ef0fd04

Please sign in to comment.