weapp-vite 3.0.0 → 3.0.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.
package/dist/index.cjs CHANGED
@@ -1,25 +1,25 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk7E6I5K2Pcjs = require('./chunk-7E6I5K2P.cjs');
4
+ var _chunkTQKIOJUXcjs = require('./chunk-TQKIOJUX.cjs');
5
5
 
6
6
 
7
- var _chunkQAOZGE4Pcjs = require('./chunk-QAOZGE4P.cjs');
7
+ var _chunkI7VYO5OFcjs = require('./chunk-I7VYO5OF.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunkKT4ZGCA4cjs = require('./chunk-KT4ZGCA4.cjs');
14
+ var _chunkILAIINMUcjs = require('./chunk-ILAIINMU.cjs');
15
15
 
16
16
 
17
17
 
18
- var _chunkTZP4YYULcjs = require('./chunk-TZP4YYUL.cjs');
18
+ var _chunkRJF2LDZWcjs = require('./chunk-RJF2LDZW.cjs');
19
19
 
20
20
  // src/index.ts
21
- _chunkTZP4YYULcjs.init_cjs_shims.call(void 0, );
22
- var import_reflect_metadata = _chunkTZP4YYULcjs.__toESM.call(void 0, _chunk7E6I5K2Pcjs.require_Reflect.call(void 0, ), 1);
21
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
22
+ var import_reflect_metadata = _chunkRJF2LDZWcjs.__toESM.call(void 0, _chunkTQKIOJUXcjs.require_Reflect.call(void 0, ), 1);
23
23
 
24
24
 
25
25
 
@@ -28,4 +28,4 @@ var import_reflect_metadata = _chunkTZP4YYULcjs.__toESM.call(void 0, _chunk7E6I5
28
28
 
29
29
 
30
30
 
31
- exports.createCompilerContext = _chunk7E6I5K2Pcjs.createCompilerContext; exports.defineAppJson = _chunkKT4ZGCA4cjs.defineAppJson; exports.defineComponentJson = _chunkKT4ZGCA4cjs.defineComponentJson; exports.defineConfig = _chunkQAOZGE4Pcjs.defineConfig; exports.definePageJson = _chunkKT4ZGCA4cjs.definePageJson; exports.defineSitemapJson = _chunkKT4ZGCA4cjs.defineSitemapJson; exports.defineThemeJson = _chunkKT4ZGCA4cjs.defineThemeJson;
31
+ exports.createCompilerContext = _chunkTQKIOJUXcjs.createCompilerContext; exports.defineAppJson = _chunkILAIINMUcjs.defineAppJson; exports.defineComponentJson = _chunkILAIINMUcjs.defineComponentJson; exports.defineConfig = _chunkI7VYO5OFcjs.defineConfig; exports.definePageJson = _chunkILAIINMUcjs.definePageJson; exports.defineSitemapJson = _chunkILAIINMUcjs.defineSitemapJson; exports.defineThemeJson = _chunkILAIINMUcjs.defineThemeJson;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,11 @@
1
- import { L as LoadConfigOptions, C as CompilerContext } from './config-DzXsLdA5.cjs';
2
- export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DzXsLdA5.cjs';
1
+ import { L as LoadConfigOptions, C as CompilerContext } from './config-CmnUGB9g.cjs';
2
+ export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-CmnUGB9g.cjs';
3
3
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
4
4
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
5
5
  import './types-dS68tjL6.cjs';
6
6
  import 'tsup';
7
7
  import 'vite-tsconfig-paths';
8
+ import 'package-manager-detector';
8
9
  import 'pkg-types';
9
10
  import 'rollup';
10
11
  import 'ts-morph';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { L as LoadConfigOptions, C as CompilerContext } from './config-Gvt9DtKU.js';
2
- export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-Gvt9DtKU.js';
1
+ import { L as LoadConfigOptions, C as CompilerContext } from './config-nkS0_6JW.js';
2
+ export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-nkS0_6JW.js';
3
3
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
4
4
  export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
5
5
  import './types-dS68tjL6.js';
6
6
  import 'tsup';
7
7
  import 'vite-tsconfig-paths';
8
+ import 'package-manager-detector';
8
9
  import 'pkg-types';
9
10
  import 'rollup';
10
11
  import 'ts-morph';
package/dist/index.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  createCompilerContext,
3
3
  require_Reflect
4
- } from "./chunk-VGP6FV6Q.mjs";
4
+ } from "./chunk-WC7SBOSS.mjs";
5
5
  import {
6
6
  defineConfig
7
- } from "./chunk-54NJAAHW.mjs";
7
+ } from "./chunk-HYF6JF4U.mjs";
8
8
  import {
9
9
  defineAppJson,
10
10
  defineComponentJson,
11
11
  definePageJson,
12
12
  defineSitemapJson,
13
13
  defineThemeJson
14
- } from "./chunk-RLY54DWG.mjs";
14
+ } from "./chunk-PRR5DJHJ.mjs";
15
15
  import {
16
16
  __toESM,
17
17
  init_esm_shims
18
- } from "./chunk-MBYCEEYQ.mjs";
18
+ } from "./chunk-J4FW3JHK.mjs";
19
19
 
20
20
  // src/index.ts
21
21
  init_esm_shims();
package/dist/json.cjs CHANGED
@@ -4,12 +4,12 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkKT4ZGCA4cjs = require('./chunk-KT4ZGCA4.cjs');
8
- require('./chunk-TZP4YYUL.cjs');
7
+ var _chunkILAIINMUcjs = require('./chunk-ILAIINMU.cjs');
8
+ require('./chunk-RJF2LDZW.cjs');
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
14
 
15
- exports.defineAppJson = _chunkKT4ZGCA4cjs.defineAppJson; exports.defineComponentJson = _chunkKT4ZGCA4cjs.defineComponentJson; exports.definePageJson = _chunkKT4ZGCA4cjs.definePageJson; exports.defineSitemapJson = _chunkKT4ZGCA4cjs.defineSitemapJson; exports.defineThemeJson = _chunkKT4ZGCA4cjs.defineThemeJson;
15
+ exports.defineAppJson = _chunkILAIINMUcjs.defineAppJson; exports.defineComponentJson = _chunkILAIINMUcjs.defineComponentJson; exports.definePageJson = _chunkILAIINMUcjs.definePageJson; exports.defineSitemapJson = _chunkILAIINMUcjs.defineSitemapJson; exports.defineThemeJson = _chunkILAIINMUcjs.defineThemeJson;
package/dist/json.d.cts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
2
- export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DzXsLdA5.cjs';
2
+ export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-CmnUGB9g.cjs';
3
3
  import 'vite';
4
4
  import './types-dS68tjL6.cjs';
5
5
  import 'tsup';
6
6
  import 'vite-tsconfig-paths';
7
+ import 'package-manager-detector';
7
8
  import 'pkg-types';
8
9
  import 'rollup';
9
10
  import 'ts-morph';
package/dist/json.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
2
- export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-Gvt9DtKU.js';
2
+ export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-nkS0_6JW.js';
3
3
  import 'vite';
4
4
  import './types-dS68tjL6.js';
5
5
  import 'tsup';
6
6
  import 'vite-tsconfig-paths';
7
+ import 'package-manager-detector';
7
8
  import 'pkg-types';
8
9
  import 'rollup';
9
10
  import 'ts-morph';
package/dist/json.mjs CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  definePageJson,
5
5
  defineSitemapJson,
6
6
  defineThemeJson
7
- } from "./chunk-RLY54DWG.mjs";
8
- import "./chunk-MBYCEEYQ.mjs";
7
+ } from "./chunk-PRR5DJHJ.mjs";
8
+ import "./chunk-J4FW3JHK.mjs";
9
9
  export {
10
10
  defineAppJson,
11
11
  defineComponentJson,
package/dist/types.cjs ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ var _chunkRJF2LDZWcjs = require('./chunk-RJF2LDZW.cjs');
4
+
5
+ // src/types/index.ts
6
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
7
+
8
+ // src/types/config.ts
9
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
10
+
11
+ // src/types/context.ts
12
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
13
+
14
+ // src/types/entry.ts
15
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
16
+
17
+ // src/types/plugin.ts
18
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
@@ -0,0 +1,57 @@
1
+ import { C as CompilerContext, E as Entry, W as WxmlDep, S as SubPackageMetaValue } from './config-CmnUGB9g.cjs';
2
+ export { A as Alias, g as AliasOptions, v as AppEntry, n as AutoImportComponents, u as BaseEntry, B as BuildNpmPackageMeta, x as ComponentEntry, t as ComponentsMap, m as CopyGlobs, l as CopyOptions, q as EnhanceOptions, o as EnhanceWxmlOptions, y as EntryJsonFragment, i as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFilenamesOptions, k as GenerateOptions, H as HandleWxmlOptions, M as MpPlatform, w as PageEntry, P as ProjectConfig, R as ResolvedAlias, s as ScanComponentItem, p as ScanWxmlOptions, h as SubPackage, U as UserConfig, r as WeappViteConfig } from './config-CmnUGB9g.cjs';
3
+ import { EmittedFile, InputOption, PluginContext, InputOptions, OutputBundle, ChangeEvent } from 'rollup';
4
+ import { ResolvedConfig } from 'vite';
5
+ export { a as Resolver } from './types-dS68tjL6.cjs';
6
+ export { Options as TsupOptions } from 'tsup';
7
+ import 'vite-tsconfig-paths';
8
+ import '@weapp-core/schematics';
9
+ import 'package-manager-detector';
10
+ import 'pkg-types';
11
+ import 'ts-morph';
12
+ import 'node:buffer';
13
+
14
+ interface IFileMeta {
15
+ relPath: string;
16
+ absPath: string;
17
+ fileName: string;
18
+ }
19
+ /**
20
+ * 生命周期跟着 vite build 走的插件
21
+ * 所以在构建主体 和 独立分包的时候,会多次触发
22
+ */
23
+ declare class VitePluginService {
24
+ ctx: CompilerContext;
25
+ resolvedConfig: ResolvedConfig;
26
+ entriesSet: Set<string>;
27
+ entries: Entry[];
28
+ cachedEmittedFiles: EmittedFile[];
29
+ cachedWatchFiles: string[];
30
+ cachedWorkerFiles: IFileMeta[];
31
+ constructor(ctx: CompilerContext);
32
+ configResolved(config: ResolvedConfig): void;
33
+ getInputOption(entries: string[]): Record<string, string>;
34
+ getUserDefinedInput(input?: InputOption): Record<string, string> | undefined;
35
+ mergeInputOption(entries: string[], input?: InputOption): any;
36
+ handleWxsDeps(deps: WxmlDep[], absPath: string): Promise<void>;
37
+ addModulesHot(pluginContext: PluginContext): void;
38
+ resetCache(): void;
39
+ options(options: InputOptions, subPackageMeta?: SubPackageMetaValue): Promise<void>;
40
+ buildStart(pluginContext: PluginContext): void;
41
+ buildEnd(pluginContext: PluginContext): void;
42
+ resolveId(id: string): string | undefined;
43
+ load(id: string, pluginContext: PluginContext): Promise<{
44
+ code: string;
45
+ } | undefined>;
46
+ generateBundle(bundle: OutputBundle, pluginContext: PluginContext): Promise<void>;
47
+ watchChange(id: string, change: {
48
+ event: ChangeEvent;
49
+ }): void;
50
+ }
51
+
52
+ interface WeappVitePluginApi {
53
+ ctx: CompilerContext;
54
+ service: VitePluginService;
55
+ }
56
+
57
+ export { Entry, SubPackageMetaValue, type WeappVitePluginApi, WxmlDep };
@@ -0,0 +1,57 @@
1
+ import { C as CompilerContext, E as Entry, W as WxmlDep, S as SubPackageMetaValue } from './config-nkS0_6JW.js';
2
+ export { A as Alias, g as AliasOptions, v as AppEntry, n as AutoImportComponents, u as BaseEntry, B as BuildNpmPackageMeta, x as ComponentEntry, t as ComponentsMap, m as CopyGlobs, l as CopyOptions, q as EnhanceOptions, o as EnhanceWxmlOptions, y as EntryJsonFragment, i as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFilenamesOptions, k as GenerateOptions, H as HandleWxmlOptions, M as MpPlatform, w as PageEntry, P as ProjectConfig, R as ResolvedAlias, s as ScanComponentItem, p as ScanWxmlOptions, h as SubPackage, U as UserConfig, r as WeappViteConfig } from './config-nkS0_6JW.js';
3
+ import { EmittedFile, InputOption, PluginContext, InputOptions, OutputBundle, ChangeEvent } from 'rollup';
4
+ import { ResolvedConfig } from 'vite';
5
+ export { a as Resolver } from './types-dS68tjL6.js';
6
+ export { Options as TsupOptions } from 'tsup';
7
+ import 'vite-tsconfig-paths';
8
+ import '@weapp-core/schematics';
9
+ import 'package-manager-detector';
10
+ import 'pkg-types';
11
+ import 'ts-morph';
12
+ import 'node:buffer';
13
+
14
+ interface IFileMeta {
15
+ relPath: string;
16
+ absPath: string;
17
+ fileName: string;
18
+ }
19
+ /**
20
+ * 生命周期跟着 vite build 走的插件
21
+ * 所以在构建主体 和 独立分包的时候,会多次触发
22
+ */
23
+ declare class VitePluginService {
24
+ ctx: CompilerContext;
25
+ resolvedConfig: ResolvedConfig;
26
+ entriesSet: Set<string>;
27
+ entries: Entry[];
28
+ cachedEmittedFiles: EmittedFile[];
29
+ cachedWatchFiles: string[];
30
+ cachedWorkerFiles: IFileMeta[];
31
+ constructor(ctx: CompilerContext);
32
+ configResolved(config: ResolvedConfig): void;
33
+ getInputOption(entries: string[]): Record<string, string>;
34
+ getUserDefinedInput(input?: InputOption): Record<string, string> | undefined;
35
+ mergeInputOption(entries: string[], input?: InputOption): any;
36
+ handleWxsDeps(deps: WxmlDep[], absPath: string): Promise<void>;
37
+ addModulesHot(pluginContext: PluginContext): void;
38
+ resetCache(): void;
39
+ options(options: InputOptions, subPackageMeta?: SubPackageMetaValue): Promise<void>;
40
+ buildStart(pluginContext: PluginContext): void;
41
+ buildEnd(pluginContext: PluginContext): void;
42
+ resolveId(id: string): string | undefined;
43
+ load(id: string, pluginContext: PluginContext): Promise<{
44
+ code: string;
45
+ } | undefined>;
46
+ generateBundle(bundle: OutputBundle, pluginContext: PluginContext): Promise<void>;
47
+ watchChange(id: string, change: {
48
+ event: ChangeEvent;
49
+ }): void;
50
+ }
51
+
52
+ interface WeappVitePluginApi {
53
+ ctx: CompilerContext;
54
+ service: VitePluginService;
55
+ }
56
+
57
+ export { Entry, SubPackageMetaValue, type WeappVitePluginApi, WxmlDep };
package/dist/types.mjs ADDED
@@ -0,0 +1,18 @@
1
+ import {
2
+ init_esm_shims
3
+ } from "./chunk-J4FW3JHK.mjs";
4
+
5
+ // src/types/index.ts
6
+ init_esm_shims();
7
+
8
+ // src/types/config.ts
9
+ init_esm_shims();
10
+
11
+ // src/types/context.ts
12
+ init_esm_shims();
13
+
14
+ // src/types/entry.ts
15
+ init_esm_shims();
16
+
17
+ // src/types/plugin.ts
18
+ init_esm_shims();
package/dist/volar.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkTZP4YYULcjs = require('./chunk-TZP4YYUL.cjs');
3
+ var _chunkRJF2LDZWcjs = require('./chunk-RJF2LDZW.cjs');
4
4
 
5
5
  // src/volar.ts
6
- _chunkTZP4YYULcjs.init_cjs_shims.call(void 0, );
6
+ _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
7
7
  var _volar = require('@weapp-vite/volar'); var _volar2 = _interopRequireDefault(_volar);
8
8
  var volar_default = _volar2.default;
9
9
 
package/dist/volar.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-MBYCEEYQ.mjs";
3
+ } from "./chunk-J4FW3JHK.mjs";
4
4
 
5
5
  // src/volar.ts
6
6
  init_esm_shims();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "3.0.0",
4
+ "version": "3.0.2",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -40,6 +40,16 @@
40
40
  "import": "./dist/json.mjs",
41
41
  "require": "./dist/json.cjs"
42
42
  },
43
+ "./volar": {
44
+ "types": "./dist/volar.d.ts",
45
+ "import": "./dist/volar.mjs",
46
+ "require": "./dist/volar.cjs"
47
+ },
48
+ "./types": {
49
+ "types": "./dist/types.d.ts",
50
+ "import": "./dist/types.mjs",
51
+ "require": "./dist/types.cjs"
52
+ },
43
53
  "./auto-import-components/resolvers": {
44
54
  "types": "./dist/auto-import-components/resolvers.d.ts",
45
55
  "import": "./dist/auto-import-components/resolvers.mjs",
@@ -81,8 +91,10 @@
81
91
  },
82
92
  "dependencies": {
83
93
  "@babel/core": "^7.26.10",
94
+ "@babel/parser": "^7.26.10",
84
95
  "@babel/preset-env": "^7.26.9",
85
96
  "@babel/preset-typescript": "^7.26.0",
97
+ "@babel/traverse": "^7.26.10",
86
98
  "@babel/types": "^7.26.10",
87
99
  "comment-json": "^4.2.5",
88
100
  "debug": "^4.4.0",
@@ -94,13 +106,13 @@
94
106
  "postcss": "^8.5.3",
95
107
  "ts-morph": "^25.0.1",
96
108
  "tsup": "^8.4.0",
97
- "vite": "^6.2.1",
109
+ "vite": "^6.2.2",
98
110
  "vite-tsconfig-paths": "^5.1.4",
99
111
  "@weapp-core/init": "^1.1.16",
112
+ "@weapp-core/logger": "^1.0.3",
100
113
  "@weapp-core/schematics": "^1.0.10",
101
- "@weapp-vite/volar": "^0.0.0",
102
114
  "@weapp-core/shared": "^1.0.6",
103
- "@weapp-core/logger": "^1.0.3",
115
+ "@weapp-vite/volar": "^0.0.0",
104
116
  "weapp-ide-cli": "^2.0.10"
105
117
  },
106
118
  "publishConfig": {
@@ -111,18 +123,20 @@
111
123
  "bundle-require": "^5.1.0",
112
124
  "cac": "^6.7.14",
113
125
  "del": "^8.0.0",
126
+ "esbuild-plugins-node-modules-polyfill": "^1.7.0",
114
127
  "htmlparser2": "^10.0.0",
115
- "inversify": "^7.1.0",
128
+ "inversify": "^7.2.0",
116
129
  "local-pkg": "^1.1.1",
117
130
  "lru-cache": "^10.4.3",
118
131
  "magic-string": "^0.30.17",
132
+ "package-manager-detector": "^1.1.0",
119
133
  "reflect-metadata": "^0.2.2",
120
134
  "rimraf": "5.0.10",
121
135
  "vue": "^3.5.13"
122
136
  },
123
137
  "scripts": {
124
- "dev": "tsup --watch --sourcemap",
125
- "dev:unbuild": "unbuild --stub",
138
+ "dev": "unbuild --stub",
139
+ "build:watch": "tsup --watch --sourcemap",
126
140
  "build": "tsup",
127
141
  "release": "tsx scripts/release.ts",
128
142
  "test:dev": "vitest",