Skip to content

Commit

Permalink
Remove unnecessary concat
Browse files Browse the repository at this point in the history
  • Loading branch information
chadfawcett committed Oct 21, 2018
1 parent e2cf993 commit f42fb81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/react/src/server/cra_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,15 @@ export function getCraWebpackConfig(mode) {
}

export function applyCRAWebpackConfig(baseConfig) {
// Remove style rules from baseConfig
// Remove any rules from baseConfig that test true for any one of the extensions
const baseRulesExcludingStyles = baseConfig.module.rules.filter(
rule => !rule.test || !['.css', '.scss', '.sass'].some(normalizeCondition(rule.test))
);

// Load create-react-app config
const craWebpackConfig = getCraWebpackConfig(baseConfig.mode);

// Concat will ensure rules is an array
const craStyleRules = getStyleRules([].concat(craWebpackConfig.module.rules));
const craStyleRules = getStyleRules(craWebpackConfig.module.rules);

// Add css minification for production
const plugins = [...baseConfig.plugins];
Expand Down

0 comments on commit f42fb81

Please sign in to comment.