mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
feat: rspack
This commit is contained in:
25
tools/scripts/pack-rspack.mjs
Executable file
25
tools/scripts/pack-rspack.mjs
Executable file
@ -0,0 +1,25 @@
|
||||
#!/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);
|
Reference in New Issue
Block a user