Skip to content

Commit

Permalink
temp fix: resolve mini-css-extractor-plugin to an older version for c…
Browse files Browse the repository at this point in the history
…ra-template & projects-test (microsoft#21295)

* temp fix: resolve mini-css-extractor-plugin to older version

* Change files

* add temp fix to northstar projects test

* remove console log
  • Loading branch information
TristanWatanabe authored and Marion Le Pontois committed Jan 17, 2022
1 parent 76c0ba6 commit 786bd11
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "temp fix: resolve mini-css-extractor-plugin to older version to fix error.",
"packageName": "@fluentui/cra-template",
"email": "tristan.watanabe@gmail.com",
"dependentChangeType": "none"
}
8 changes: 8 additions & 0 deletions packages/cra-template/scripts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ async function runE2ETest() {

logger('STEP 2. Create test React app from template');
await prepareCreateReactApp(tempPaths, `file:${templatePath}`);
/**
* This is a temporary quick-fix solution. Remove once issue with mini-css-extract-plugin
* is resolved @see https://github.com/facebook/create-react-app/issues/11930
*/
const parsedJSON = JSON.parse(fs.readFileSync(`${tempPaths.testApp}/package.json`, 'utf-8'));
parsedJSON.resolutions['mini-css-extract-plugin'] = '2.4.5';
fs.writeFileSync(`${tempPaths.testApp}/package.json`, JSON.stringify(parsedJSON));

await shEcho('yarn add cross-env', tempPaths.testApp);
logger(`✔️ Test React app is successfully created: ${tempPaths.testApp}`);

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 @@ -37,6 +37,14 @@ export async function createReactApp() {
const packedPackages = await packProjectPackages(logger, config.paths.packages(), ['@fluentui/react-northstar']);
await addResolutionPathsForProjectPackages(testAppPath());

/**
* This is a temporary quick-fix solution. Remove once issue with mini-css-extract-plugin
* is resolved @see https://github.com/facebook/create-react-app/issues/11930
*/
const parsedJSON = JSON.parse(fs.readFileSync(`${tempPaths.testApp}/package.json`, 'utf-8'));
parsedJSON.resolutions['mini-css-extract-plugin'] = '2.4.5';
fs.writeFileSync(`${tempPaths.testApp}/package.json`, JSON.stringify(parsedJSON));

await shEcho(`yarn add ${packedPackages['@fluentui/react-northstar']}`, testAppPath());
logger(`✔️ Fluent UI packages were added to dependencies`);

Expand Down

0 comments on commit 786bd11

Please sign in to comment.