Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Oct 3, 2023
1 parent 509f22b commit ec4db19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/presets/create-react-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ const webpack = async (

// Remove existing rules related to JavaScript and TypeScript.
logger.info(`=> Removing existing JavaScript and TypeScript rules.`);
const filteredRules = webpackConfig.module?.rules?.filter((rule: RuleSetRule | '...') => {
if (typeof rule === 'string') return false;
const filteredRules = (webpackConfig.module?.rules as RuleSetRule[])?.filter((rule) => {
if (typeof rule === 'string') {
return false;
}
const { test } = rule;
return !(test instanceof RegExp && (test?.test('.js') || test?.test('.ts')));
});
Expand Down

0 comments on commit ec4db19

Please sign in to comment.