-
-
Save yungblud/dd6b8434d95c3b7ee4780b875d34523d to your computer and use it in GitHub Desktop.
Fix including yarn workspaces packages in create-react-app with craco
This file contains hidden or 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
| module.exports = { | |
| webpack: { | |
| configure: (webpackConfig) => ({ | |
| ...webpackConfig, | |
| module: { | |
| ...webpackConfig.module, | |
| rules: webpackConfig.module.rules.map((rule) => { | |
| if (!rule.oneOf) return rule; | |
| return { | |
| ...rule, | |
| oneOf: rule.oneOf.map((ruleObject) => { | |
| if ( | |
| !new RegExp(ruleObject.test).test('.ts') || | |
| !ruleObject.include | |
| ) | |
| return ruleObject; | |
| return { ...ruleObject, include: undefined }; | |
| }), | |
| }; | |
| }), | |
| }, | |
| }), | |
| }, | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment