Skip to content

Commit

Permalink
cra-template: temporarily add resolution for babel to work around bug (
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Feb 3, 2022
1 parent 0a22089 commit 946f57c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Temporarily add resolution for `@babel/core` to work around bug",
"packageName": "@fluentui/cra-template",
"email": "elcraig@microsoft.com",
"dependentChangeType": "patch"
}
3 changes: 3 additions & 0 deletions packages/cra-template/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"typescript": "^4.1.2",
"web-vitals": "^1.0.1"
},
"resolutions": {
"@babel/core": "7.16.12"
},
"eslintConfig": {
"extends": ["react-app", "react-app/jest"]
}
Expand Down
8 changes: 8 additions & 0 deletions packages/fluentui/projects-test/src/createReactApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ export async function createReactApp() {

await prepareCreateReactApp(tempPaths, 'typescript');
const testAppPath = config.paths.withRootAt(tempPaths.testApp);

// TODO: remove once babel issue is fixed (tracked by https://github.com/microsoft/fluentui/issues/21546)
logger('Add resolution to work around @babel/core issue');
const packageJson = fs.readJSONSync(testAppPath('package.json'));
packageJson.resolutions = { '@babel/core': '7.16.12' };
fs.writeJSONSync(testAppPath('package.json'), packageJson, { spaces: 2 });
await shEcho('yarn', testAppPath());

logger(`Test React project is successfully created: ${testAppPath()}`);

logger('STEP 2. Add Fluent UI dependency to test project..');
Expand Down

0 comments on commit 946f57c

Please sign in to comment.