react/scripts/release/build-release-locally-commands/build-artifacts.js
PrathamLalwani 2c338b16fd
Added windows powershell syntax to build scripts (#27692)
## Summary

I had to change the commands to be windows specific so that it doesn't
cause any crashes

## How did you test this change?

I successfully built the different types of devtools extenstions on my
personal computer. In future may need to add a github action with
windows config to test these errors

 #27193
2023-11-16 11:35:43 +00:00

27 lines
686 B
JavaScript

#!/usr/bin/env node
'use strict';
const {exec} = require('child-process-promise');
const {join} = require('path');
const {logPromise} = require('../utils');
const shell = require('shelljs');
const run = async ({cwd, dry, tempDirectory}) => {
const defaultOptions = {
cwd: tempDirectory,
};
await exec('yarn install', defaultOptions);
await exec('yarn build -- --extract-errors', defaultOptions);
const tempNodeModulesPath = join(tempDirectory, 'build', 'node_modules');
const buildPath = join(cwd, 'build');
shell.cp('-r', tempNodeModulesPath, buildPath);
};
module.exports = async params => {
return logPromise(run(params), 'Building artifacts', 600000);
};