From 1fe6f4409c1fd68bc7f48ba54a3ea4632d1d4fa9 Mon Sep 17 00:00:00 2001 From: Xc Date: Wed, 9 Jul 2025 11:02:27 +0800 Subject: [PATCH] =?UTF-8?q?makeDep=E4=BF=AE=E6=AD=A3=E4=BA=86=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/index.js | 1 + lib/makeDependency.js | 3 ++- scripts/make-dependency.js | 2 +- src/build.ts | 1 - src/index.ts | 1 + src/makeDependency.ts | 3 ++- 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 715f627..069315d 100755 --- a/lib/index.js +++ b/lib/index.js @@ -56,6 +56,7 @@ commander_1.default .action(makeLocale_1.default); commander_1.default .command('make:dependency') + .option('-r --rebuild', 'rebuild') .description('make dependency') .action(makeDependency_1.default); commander_1.default diff --git a/lib/makeDependency.js b/lib/makeDependency.js index 07f6a2e..271c321 100644 --- a/lib/makeDependency.js +++ b/lib/makeDependency.js @@ -6,7 +6,8 @@ const cross_spawn_1 = tslib_1.__importDefault(require("cross-spawn")); const path_1 = require("path"); async function make(cmd) { (0, tip_style_1.Success)(`${(0, tip_style_1.success)(`make dependecy`)}`); - const args = [(0, path_1.resolve)(__dirname, '../scripts/make-dependency.js'), 'true']; + const rebuild = !!cmd.rebuild; + const args = [(0, path_1.resolve)(__dirname, '../scripts/make-dependency.js'), `${rebuild}`]; const result = cross_spawn_1.default.sync('node', args, { stdio: 'inherit', shell: true, diff --git a/scripts/make-dependency.js b/scripts/make-dependency.js index e366cbd..959e270 100644 --- a/scripts/make-dependency.js +++ b/scripts/make-dependency.js @@ -1,3 +1,3 @@ -const rebuild = process.argv[2]; +const rebuild = process.argv[2] === 'true'; const startUpBuilder = require('oak-domain/lib/compiler/dependencyBuilder').default; startUpBuilder(!!rebuild); \ No newline at end of file diff --git a/src/build.ts b/src/build.ts index a5912bd..d9b9f7c 100644 --- a/src/build.ts +++ b/src/build.ts @@ -11,7 +11,6 @@ import spawn from 'cross-spawn'; import { resolve } from 'path'; import makeLocale from './makeLocale'; import makeRouter from './makeRouter'; -import makeDep from './makeDependency'; import { copyFileSync } from 'fs'; type Mode = 'development' | 'staging' | 'production'; diff --git a/src/index.ts b/src/index.ts index 3784f54..f4ad0c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -63,6 +63,7 @@ program program .command('make:dependency') + .option('-r --rebuild', 'rebuild') .description('make dependency') .action(makeDependency); diff --git a/src/makeDependency.ts b/src/makeDependency.ts index 980c24e..e3d39f5 100644 --- a/src/makeDependency.ts +++ b/src/makeDependency.ts @@ -12,7 +12,8 @@ import { resolve } from 'path'; export default async function make(cmd: any) { Success(`${success(`make dependecy`)}`); - const args = [resolve(__dirname, '../scripts/make-dependency.js'), 'true']; + const rebuild = !!cmd.rebuild; + const args = [resolve(__dirname, '../scripts/make-dependency.js'), `${rebuild}`]; const result = spawn.sync( 'node',