fix(cra-to-nx): use cross-env to ensure Windows compatibility with CRA build script (#12838)
This commit is contained in:
parent
e39cb42c86
commit
48c6024fd5
@ -6,7 +6,7 @@ export function addCRAcracoScriptsToPackageJson(appName: string) {
|
|||||||
...packageJson.scripts,
|
...packageJson.scripts,
|
||||||
start: 'craco start',
|
start: 'craco start',
|
||||||
serve: 'npm 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',
|
test: 'craco test',
|
||||||
};
|
};
|
||||||
writeJsonSync(`apps/${appName}/package.json`, packageJson, { spaces: 2 });
|
writeJsonSync(`apps/${appName}/package.json`, packageJson, { spaces: 2 });
|
||||||
|
|||||||
@ -165,6 +165,7 @@ export async function createNxWorkspaceForReact(options: Record<string, any>) {
|
|||||||
addDependency('@craco/craco', true);
|
addDependency('@craco/craco', true);
|
||||||
addDependency('web-vitals', true);
|
addDependency('web-vitals', true);
|
||||||
addDependency('jest-watch-typeahead', true); // Only for ts apps?
|
addDependency('jest-watch-typeahead', true); // Only for ts apps?
|
||||||
|
addDependency('cross-env', true);
|
||||||
|
|
||||||
output.log({
|
output.log({
|
||||||
title: '🎉 Done!',
|
title: '🎉 Done!',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user