Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const process = require('process');
const { LocJsonPreprocessor } = require('@rushstack/localization-plugin');
function executeCommand(command) {
console.log('---> ' + command);
child_process.execSync(command, { stdio: 'inherit' });
}
// Clean the old build outputs
console.log(`==> Starting build.js for ${path.basename(process.cwd())}`);
fsx.emptyDirSync('dist');
fsx.emptyDirSync('lib');
fsx.emptyDirSync('temp');
LocJsonPreprocessor.preprocessLocJsonFiles({
srcFolder: path.resolve(__dirname, 'src'),
generatedTsFolder: path.resolve(__dirname, 'temp', 'loc-json-ts')
});
// Run Webpack
executeCommand('node node_modules/webpack-cli/bin/cli');
console.log(`==> Finished build.js for ${path.basename(process.cwd())}`);