fix(cra-to-nx): use cross-env to ensure Windows compatibility with CRA build script (#12838)

This commit is contained in:
Mérill Téterel 2022-10-28 17:23:48 +02:00 committed by GitHub
parent e39cb42c86
commit 48c6024fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,7 @@ export function addCRAcracoScriptsToPackageJson(appName: string) {
...packageJson.scripts,
start: 'craco start',
serve: 'npm start',
build: `BUILD_PATH=../../dist/apps/${appName} craco build`,
build: `cross-env BUILD_PATH=../../dist/apps/${appName} craco build`,
test: 'craco test',
};
writeJsonSync(`apps/${appName}/package.json`, packageJson, { spaces: 2 });

View File

@ -165,6 +165,7 @@ export async function createNxWorkspaceForReact(options: Record<string, any>) {
addDependency('@craco/craco', true);
addDependency('web-vitals', true);
addDependency('jest-watch-typeahead', true); // Only for ts apps?
addDependency('cross-env', true);
output.log({
title: '🎉 Done!',