@jayfong/x-server 2.88.2 → 2.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,9 @@ class BuildUtil {
58
58
  } catch {}
59
59
 
60
60
  // 构建
61
- await _fsExtra.default.emptyDir(distDir);
61
+ if (!options.noEmptyDistDir) {
62
+ await _fsExtra.default.emptyDir(distDir);
63
+ }
62
64
  // @ts-ignore
63
65
  const {
64
66
  default: macrosPlugin
@@ -169,6 +169,10 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
169
169
  describe: '是否包含 Prisma 引擎',
170
170
  type: 'boolean',
171
171
  default: true
172
+ }).positional('empty-dist-dir', {
173
+ describe: '是否清空构建目录',
174
+ type: 'boolean',
175
+ default: true
172
176
  }), async argv => {
173
177
  await _env_util.EnvUtil.withChannel({
174
178
  cwd: process.cwd(),
@@ -208,7 +212,8 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
208
212
  });
209
213
  }),
210
214
  prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
211
- noPrismaEngine: argv['prisma-engine'] === false
215
+ noPrismaEngine: argv['prisma-engine'] === false,
216
+ noEmptyDistDir: argv['empty-dist-dir'] === false
212
217
  });
213
218
  console.log('构建成功');
214
219
  if (argv.deploy) {
@@ -9,6 +9,7 @@ export interface BuildOptions {
9
9
  excludeFiles?: string[];
10
10
  prismaCliBinaryTargets?: string;
11
11
  noPrismaEngine?: boolean;
12
+ noEmptyDistDir?: boolean;
12
13
  }
13
14
  export declare class BuildUtil {
14
15
  static build(options: BuildOptions): Promise<void>;
@@ -52,7 +52,9 @@ export class BuildUtil {
52
52
  } catch {}
53
53
 
54
54
  // 构建
55
- await fs.emptyDir(distDir);
55
+ if (!options.noEmptyDistDir) {
56
+ await fs.emptyDir(distDir);
57
+ }
56
58
  // @ts-ignore
57
59
  const {
58
60
  default: macrosPlugin
package/lib/cli/cli.js CHANGED
@@ -167,6 +167,10 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
167
167
  describe: '是否包含 Prisma 引擎',
168
168
  type: 'boolean',
169
169
  default: true
170
+ }).positional('empty-dist-dir', {
171
+ describe: '是否清空构建目录',
172
+ type: 'boolean',
173
+ default: true
170
174
  }), async argv => {
171
175
  await EnvUtil.withChannel({
172
176
  cwd: process.cwd(),
@@ -206,7 +210,8 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
206
210
  });
207
211
  }),
208
212
  prismaCliBinaryTargets: envMap.PRISMA_CLI_BINARY_TARGETS,
209
- noPrismaEngine: argv['prisma-engine'] === false
213
+ noPrismaEngine: argv['prisma-engine'] === false,
214
+ noEmptyDistDir: argv['empty-dist-dir'] === false
210
215
  });
211
216
  console.log('构建成功');
212
217
  if (argv.deploy) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.88.2",
3
+ "version": "2.89.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",