Files
NativeScript/tools/scripts/pack-rspack.mjs
Nathan Walker 490c168571 feat: rspack
2025-03-21 16:46:17 -07:00

26 lines
628 B
JavaScript
Executable File

#!/usr/bin/env zx
import 'zx/globals';
import path from 'path';
const rspackPath = path.resolve(__dirname, '../../packages/rspack');
const distPath = path.resolve(__dirname, '../../dist/packages');
const packageJSON = await fs.readJSON(`${rspackPath}/package.json`);
const tgzName = `nativescript-rspack-${packageJSON.version}.tgz`;
cd(rspackPath);
await $`npm install`;
await $`npm pack`;
const from = path.join(rspackPath, tgzName);
const to = path.join(distPath, tgzName);
await fs.move(from, to, {
overwrite: true,
});
console.log(chalk.green(`@nativescript/rspack has been built and packed.\n`));
console.log(to);