-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Taylor Smock <[email protected]>
- Loading branch information
Showing
3 changed files
with
5,391 additions
and
6,383 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
webpack: { | ||
configure: (webpackConfig, { env, paths }) => { | ||
// Fix CRA #11770 | ||
const rules = webpackConfig.module.rules; | ||
for (const rule of rules) { | ||
if (Object.hasOwn(rule, 'oneOf')) { | ||
rule.oneOf.filter((currentValue, index, arr) => { | ||
const toRemove = | ||
currentValue.test instanceof RegExp && currentValue.test.test('something.svg'); | ||
if (toRemove) { | ||
arr.splice(index, 1); | ||
} | ||
return toRemove; | ||
}); | ||
rule.oneOf.push({ | ||
test: /\.svg$/i, | ||
issuer: { | ||
and: [/\.(ts|tsx|js|jsx|md|mdx)$/], | ||
}, | ||
type: 'asset', | ||
}); | ||
} | ||
} | ||
return webpackConfig; | ||
}, | ||
}, | ||
}; |
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
Oops, something went wrong.