weapp-vite 1.3.1 → 1.3.2

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.
@@ -3,7 +3,7 @@ import logger from "@weapp-core/logger";
3
3
  var logger_default = logger;
4
4
 
5
5
  // package.json
6
- var version = "1.3.1";
6
+ var version = "1.3.2";
7
7
 
8
8
  // src/constants.ts
9
9
  var VERSION = version;
@@ -303,6 +303,9 @@ function vitePluginWeapp(ctx) {
303
303
  // src/context.ts
304
304
  var require2 = createRequire(import.meta.url);
305
305
  var CompilerContext = class {
306
+ /**
307
+ * loadDefaultConfig 的时候会被重新赋予
308
+ */
306
309
  inlineConfig;
307
310
  cwd;
308
311
  isDev;
@@ -394,8 +397,8 @@ var CompilerContext = class {
394
397
  }).on("ready", async () => {
395
398
  await this.internalDev(inlineConfig2);
396
399
  isReady = true;
397
- logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177");
398
- logger_default.success("\u6216\u8005\u4F7F\u7528\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55 (`project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
400
+ logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01");
401
+ logger_default.success("\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u6216\u8005\u76F4\u63A5\u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55( `project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
399
402
  });
400
403
  return watcher;
401
404
  };
@@ -491,6 +494,8 @@ var CompilerContext = class {
491
494
  mode: this.mode
492
495
  }, void 0, this.cwd);
493
496
  this.inlineConfig = defu2({
497
+ configFile: false
498
+ }, loaded?.config, {
494
499
  mode: this.mode,
495
500
  build: {
496
501
  rollupOptions: {
@@ -517,12 +522,11 @@ var CompilerContext = class {
517
522
  include: void 0
518
523
  }
519
524
  },
520
- logLevel: "warn",
521
525
  plugins: [
522
526
  tsconfigPaths()
523
527
  ],
524
- configFile: false
525
- }, loaded?.config, this.inlineConfig);
528
+ logLevel: "warn"
529
+ });
526
530
  }
527
531
  // https://cn.vitejs.dev/guide/build.html#library-mode
528
532
  // miniprogram_dist
@@ -603,7 +607,12 @@ var CompilerContext = class {
603
607
  }
604
608
  }
605
609
  }
610
+ resetEntries() {
611
+ this.entriesSet.clear();
612
+ this.entries.length = 0;
613
+ }
606
614
  async scanAppEntry() {
615
+ this.resetEntries();
607
616
  const appDirname = path5.resolve(this.cwd, this.srcRoot);
608
617
  const appConfigFile = path5.resolve(appDirname, "app.json");
609
618
  const appEntry = await findJsEntry(appConfigFile);
package/dist/cli.cjs CHANGED
@@ -32,7 +32,7 @@ var import_cac = require("cac");
32
32
  var import_weapp_ide_cli = require("weapp-ide-cli");
33
33
 
34
34
  // package.json
35
- var version = "1.3.1";
35
+ var version = "1.3.2";
36
36
 
37
37
  // src/constants.ts
38
38
  var VERSION = version;
@@ -336,6 +336,9 @@ function vitePluginWeapp(ctx) {
336
336
  // src/context.ts
337
337
  var require2 = (0, import_node_module.createRequire)(importMetaUrl);
338
338
  var CompilerContext = class {
339
+ /**
340
+ * loadDefaultConfig 的时候会被重新赋予
341
+ */
339
342
  inlineConfig;
340
343
  cwd;
341
344
  isDev;
@@ -427,8 +430,8 @@ var CompilerContext = class {
427
430
  }).on("ready", async () => {
428
431
  await this.internalDev(inlineConfig2);
429
432
  isReady = true;
430
- logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177");
431
- logger_default.success("\u6216\u8005\u4F7F\u7528\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55 (`project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
433
+ logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01");
434
+ logger_default.success("\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u6216\u8005\u76F4\u63A5\u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55( `project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
432
435
  });
433
436
  return watcher;
434
437
  };
@@ -524,6 +527,8 @@ var CompilerContext = class {
524
527
  mode: this.mode
525
528
  }, void 0, this.cwd);
526
529
  this.inlineConfig = (0, import_shared3.defu)({
530
+ configFile: false
531
+ }, loaded?.config, {
527
532
  mode: this.mode,
528
533
  build: {
529
534
  rollupOptions: {
@@ -550,12 +555,11 @@ var CompilerContext = class {
550
555
  include: void 0
551
556
  }
552
557
  },
553
- logLevel: "warn",
554
558
  plugins: [
555
559
  (0, import_vite_tsconfig_paths.default)()
556
560
  ],
557
- configFile: false
558
- }, loaded?.config, this.inlineConfig);
561
+ logLevel: "warn"
562
+ });
559
563
  }
560
564
  // https://cn.vitejs.dev/guide/build.html#library-mode
561
565
  // miniprogram_dist
@@ -636,7 +640,12 @@ var CompilerContext = class {
636
640
  }
637
641
  }
638
642
  }
643
+ resetEntries() {
644
+ this.entriesSet.clear();
645
+ this.entries.length = 0;
646
+ }
639
647
  async scanAppEntry() {
648
+ this.resetEntries();
640
649
  const appDirname = import_pathe5.default.resolve(this.cwd, this.srcRoot);
641
650
  const appConfigFile = import_pathe5.default.resolve(appDirname, "app.json");
642
651
  const appEntry = await findJsEntry(appConfigFile);
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  VERSION,
3
3
  createCompilerContext,
4
4
  logger_default
5
- } from "./chunk-JB72VL2I.mjs";
5
+ } from "./chunk-455ARQ2V.mjs";
6
6
  import "./chunk-444MQSSG.mjs";
7
7
 
8
8
  // src/cli.ts
package/dist/index.cjs CHANGED
@@ -340,6 +340,9 @@ function vitePluginWeapp(ctx) {
340
340
  // src/context.ts
341
341
  var require2 = (0, import_node_module.createRequire)(importMetaUrl);
342
342
  var CompilerContext = class {
343
+ /**
344
+ * loadDefaultConfig 的时候会被重新赋予
345
+ */
343
346
  inlineConfig;
344
347
  cwd;
345
348
  isDev;
@@ -431,8 +434,8 @@ var CompilerContext = class {
431
434
  }).on("ready", async () => {
432
435
  await this.internalDev(inlineConfig2);
433
436
  isReady = true;
434
- logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177");
435
- logger_default.success("\u6216\u8005\u4F7F\u7528\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55 (`project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
437
+ logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01");
438
+ logger_default.success("\u6267\u884C `npm run open` \u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u6216\u8005\u76F4\u63A5\u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55( `project.config.json` \u6240\u5728\u76EE\u5F55) \u67E5\u770B\u6548\u679C");
436
439
  });
437
440
  return watcher;
438
441
  };
@@ -528,6 +531,8 @@ var CompilerContext = class {
528
531
  mode: this.mode
529
532
  }, void 0, this.cwd);
530
533
  this.inlineConfig = (0, import_shared3.defu)({
534
+ configFile: false
535
+ }, loaded?.config, {
531
536
  mode: this.mode,
532
537
  build: {
533
538
  rollupOptions: {
@@ -554,12 +559,11 @@ var CompilerContext = class {
554
559
  include: void 0
555
560
  }
556
561
  },
557
- logLevel: "warn",
558
562
  plugins: [
559
563
  (0, import_vite_tsconfig_paths.default)()
560
564
  ],
561
- configFile: false
562
- }, loaded?.config, this.inlineConfig);
565
+ logLevel: "warn"
566
+ });
563
567
  }
564
568
  // https://cn.vitejs.dev/guide/build.html#library-mode
565
569
  // miniprogram_dist
@@ -640,7 +644,12 @@ var CompilerContext = class {
640
644
  }
641
645
  }
642
646
  }
647
+ resetEntries() {
648
+ this.entriesSet.clear();
649
+ this.entries.length = 0;
650
+ }
643
651
  async scanAppEntry() {
652
+ this.resetEntries();
644
653
  const appDirname = import_pathe5.default.resolve(this.cwd, this.srcRoot);
645
654
  const appConfigFile = import_pathe5.default.resolve(appDirname, "app.json");
646
655
  const appEntry = await findJsEntry(appConfigFile);
package/dist/index.d.cts CHANGED
@@ -32,6 +32,9 @@ interface CompilerContextOptions {
32
32
  subPackage?: SubPackage;
33
33
  }
34
34
  declare class CompilerContext {
35
+ /**
36
+ * loadDefaultConfig 的时候会被重新赋予
37
+ */
35
38
  inlineConfig: InlineConfig;
36
39
  cwd: string;
37
40
  isDev: boolean;
@@ -59,6 +62,7 @@ declare class CompilerContext {
59
62
  sourcemap?: boolean;
60
63
  }): Promise<void>;
61
64
  private usingComponentsHandler;
65
+ resetEntries(): void;
62
66
  scanAppEntry(): Promise<void>;
63
67
  scanComponentEntry(componentEntry: string, dirname: string): Promise<void>;
64
68
  }
package/dist/index.d.ts CHANGED
@@ -32,6 +32,9 @@ interface CompilerContextOptions {
32
32
  subPackage?: SubPackage;
33
33
  }
34
34
  declare class CompilerContext {
35
+ /**
36
+ * loadDefaultConfig 的时候会被重新赋予
37
+ */
35
38
  inlineConfig: InlineConfig;
36
39
  cwd: string;
37
40
  isDev: boolean;
@@ -59,6 +62,7 @@ declare class CompilerContext {
59
62
  sourcemap?: boolean;
60
63
  }): Promise<void>;
61
64
  private usingComponentsHandler;
65
+ resetEntries(): void;
62
66
  scanAppEntry(): Promise<void>;
63
67
  scanComponentEntry(componentEntry: string, dirname: string): Promise<void>;
64
68
  }
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CompilerContext,
3
3
  createCompilerContext
4
- } from "./chunk-JB72VL2I.mjs";
4
+ } from "./chunk-455ARQ2V.mjs";
5
5
  import "./chunk-444MQSSG.mjs";
6
6
  export {
7
7
  CompilerContext,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.3.2",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",