weapp-vite 6.6.7 → 6.6.9
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/auto-import-components/resolvers.mjs +1 -1
- package/dist/auto-routes.mjs +5 -5
- package/dist/{chunk-ETXM3KLV.mjs → chunk-BP6KVMYT.mjs} +2 -2
- package/dist/{chunk-JW6WZBSG.mjs → chunk-BSEMCBBG.mjs} +1 -1
- package/dist/{chunk-I67A7GMF.mjs → chunk-DA5NTDY2.mjs} +1 -1
- package/dist/{chunk-5UFWZAGA.mjs → chunk-DLO6COLF.mjs} +1 -1
- package/dist/{chunk-ECNPEEIT.mjs → chunk-EE6XJ7ZZ.mjs} +66 -10
- package/dist/{chunk-UGN67KSR.mjs → chunk-GBMX636X.mjs} +1 -1
- package/dist/{chunk-YMOUMJD2.mjs → chunk-XJH7ESO6.mjs} +1 -1
- package/dist/{chunk-ULW7I4ZT.mjs → chunk-ZYRAVDNC.mjs} +2 -2
- package/dist/cli.mjs +4 -4
- package/dist/config.mjs +3 -3
- package/dist/{file-XPGAVEE7.mjs → file-QH43FAOQ.mjs} +2 -2
- package/dist/index.mjs +8 -8
- package/dist/json.mjs +2 -2
- package/dist/runtime.mjs +2 -2
- package/dist/types.mjs +2 -2
- package/dist/volar.mjs +1 -1
- package/package.json +5 -5
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EE6XJ7ZZ.mjs";
|
|
4
|
+
import "./chunk-DA5NTDY2.mjs";
|
|
5
|
+
import "./chunk-XJH7ESO6.mjs";
|
|
6
|
+
import "./chunk-DLO6COLF.mjs";
|
|
7
7
|
import {
|
|
8
8
|
init_esm_shims
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BP6KVMYT.mjs";
|
|
10
10
|
|
|
11
11
|
// src/auto-routes.ts
|
|
12
12
|
init_esm_shims();
|
|
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.1_@types+node@25.3.0__@swc+core@1.15.11_jiti@2_33bef0f7763aad222c45b2d476f01059/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
import path from "path";
|
|
32
32
|
import { fileURLToPath } from "url";
|
|
33
33
|
var init_esm_shims = __esm({
|
|
34
|
-
"../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.
|
|
34
|
+
"../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.1_@types+node@25.3.0__@swc+core@1.15.11_jiti@2_33bef0f7763aad222c45b2d476f01059/node_modules/tsup/assets/esm_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
templateExtensions,
|
|
15
15
|
touch,
|
|
16
16
|
vueExtensions
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DA5NTDY2.mjs";
|
|
18
18
|
import {
|
|
19
19
|
__commonJS,
|
|
20
20
|
__toESM,
|
|
21
21
|
init_esm_shims
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-BP6KVMYT.mjs";
|
|
23
23
|
|
|
24
24
|
// ../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js
|
|
25
25
|
var require_debug = __commonJS({
|
|
@@ -33460,6 +33460,18 @@ function normalizeVueTemplateForPlatform(template, options) {
|
|
|
33460
33460
|
return template;
|
|
33461
33461
|
}
|
|
33462
33462
|
}
|
|
33463
|
+
function registerVueTemplateToken(ctx, filename, template) {
|
|
33464
|
+
const wxmlService = ctx.wxmlService;
|
|
33465
|
+
if (!wxmlService) {
|
|
33466
|
+
return;
|
|
33467
|
+
}
|
|
33468
|
+
try {
|
|
33469
|
+
const token = wxmlService.analyze(template);
|
|
33470
|
+
wxmlService.tokenMap.set(filename, token);
|
|
33471
|
+
wxmlService.setWxmlComponentsMap(filename, token.components);
|
|
33472
|
+
} catch {
|
|
33473
|
+
}
|
|
33474
|
+
}
|
|
33463
33475
|
function emitAlipayGenericPlaceholderAssets(ctx, bundle, relativeBase, configSource, outputExtensions, platform) {
|
|
33464
33476
|
if (platform !== "alipay" || !configSource) {
|
|
33465
33477
|
return;
|
|
@@ -33571,11 +33583,13 @@ async function emitVueBundleAssets(bundle, state) {
|
|
|
33571
33583
|
const jsonConfig = configService.weappViteConfig?.json;
|
|
33572
33584
|
const jsonKind = isAppVue ? "app" : cached.isPage ? "page" : "component";
|
|
33573
33585
|
if (result.template) {
|
|
33574
|
-
|
|
33586
|
+
const normalizedTemplate = normalizeVueTemplateForPlatform(result.template, {
|
|
33575
33587
|
platform: configService.platform,
|
|
33576
33588
|
templateExtension,
|
|
33577
33589
|
scriptModuleExtension: configService.outputExtensions?.wxs
|
|
33578
|
-
})
|
|
33590
|
+
});
|
|
33591
|
+
registerVueTemplateToken(ctx, filename, normalizedTemplate);
|
|
33592
|
+
emitSfcTemplateIfMissing(pluginCtx, bundle, relativeBase, normalizedTemplate, templateExtension);
|
|
33579
33593
|
}
|
|
33580
33594
|
const wxsExtension = configService.outputExtensions?.wxs;
|
|
33581
33595
|
const needsClassStyleWxs = Boolean(result.classStyleWxs) || Boolean(result.scopedSlotComponents?.some((slot) => slot.classStyleWxs));
|
|
@@ -33661,11 +33675,13 @@ async function emitVueBundleAssets(bundle, state) {
|
|
|
33661
33675
|
}
|
|
33662
33676
|
}
|
|
33663
33677
|
if (result.template) {
|
|
33664
|
-
|
|
33678
|
+
const normalizedTemplate = normalizeVueTemplateForPlatform(result.template, {
|
|
33665
33679
|
platform: configService.platform,
|
|
33666
33680
|
templateExtension,
|
|
33667
33681
|
scriptModuleExtension: configService.outputExtensions?.wxs
|
|
33668
|
-
})
|
|
33682
|
+
});
|
|
33683
|
+
registerVueTemplateToken(ctx, entryFilePath, normalizedTemplate);
|
|
33684
|
+
emitSfcTemplateIfMissing(pluginCtx, bundle, relativeBase, normalizedTemplate, templateExtension);
|
|
33669
33685
|
}
|
|
33670
33686
|
const wxsExtension = configService.outputExtensions?.wxs;
|
|
33671
33687
|
const needsClassStyleWxs = Boolean(result.classStyleWxs) || Boolean(result.scopedSlotComponents?.some((slot) => slot.classStyleWxs));
|
|
@@ -33714,6 +33730,21 @@ async function emitVueBundleAssets(bundle, state) {
|
|
|
33714
33730
|
}
|
|
33715
33731
|
|
|
33716
33732
|
// src/plugins/vue/transform/plugin.ts
|
|
33733
|
+
function registerVueTemplateToken2(ctx, filename, template) {
|
|
33734
|
+
if (!template) {
|
|
33735
|
+
return;
|
|
33736
|
+
}
|
|
33737
|
+
const wxmlService = ctx.wxmlService;
|
|
33738
|
+
if (!wxmlService) {
|
|
33739
|
+
return;
|
|
33740
|
+
}
|
|
33741
|
+
try {
|
|
33742
|
+
const token = wxmlService.analyze(template);
|
|
33743
|
+
wxmlService.tokenMap.set(filename, token);
|
|
33744
|
+
wxmlService.setWxmlComponentsMap(filename, token.components);
|
|
33745
|
+
} catch {
|
|
33746
|
+
}
|
|
33747
|
+
}
|
|
33717
33748
|
function createVueTransformPlugin(ctx) {
|
|
33718
33749
|
const compilationCache = /* @__PURE__ */ new Map();
|
|
33719
33750
|
let pageMatcher = null;
|
|
@@ -33858,6 +33889,7 @@ function createVueTransformPlugin(ctx) {
|
|
|
33858
33889
|
filename,
|
|
33859
33890
|
compileOptions
|
|
33860
33891
|
);
|
|
33892
|
+
registerVueTemplateToken2(ctx, filename, result.template);
|
|
33861
33893
|
if (Array.isArray(result.meta?.sfcSrcDeps) && typeof this.addWatchFile === "function") {
|
|
33862
33894
|
for (const dep of result.meta.sfcSrcDeps) {
|
|
33863
33895
|
;
|
|
@@ -34129,7 +34161,7 @@ async function transformWxsFile(state, wxsPath) {
|
|
|
34129
34161
|
}
|
|
34130
34162
|
async function handleWxsDeps(state, deps, absPath) {
|
|
34131
34163
|
await Promise.all(
|
|
34132
|
-
deps.filter((dep) => dep.tagName === "wxs" || dep.tagName === "sjs").map(async (dep) => {
|
|
34164
|
+
deps.filter((dep) => dep.tagName === "wxs" || dep.tagName === "sjs" || dep.tagName === "import-sjs").map(async (dep) => {
|
|
34133
34165
|
const arr = dep.value.match(/\.(?:wxs|sjs)(\.[jt]s)?$/);
|
|
34134
34166
|
if (!jsExtensions.includes(dep.attrs.lang) && !arr) {
|
|
34135
34167
|
return;
|
|
@@ -34139,16 +34171,39 @@ async function handleWxsDeps(state, deps, absPath) {
|
|
|
34139
34171
|
})
|
|
34140
34172
|
);
|
|
34141
34173
|
}
|
|
34174
|
+
async function handleWxsDepsFromBundle(state, bundle) {
|
|
34175
|
+
const templateExtension = state.ctx.configService.outputExtensions?.wxml ?? "wxml";
|
|
34176
|
+
const platform = state.ctx.configService.platform;
|
|
34177
|
+
await Promise.all(
|
|
34178
|
+
Object.entries(bundle).filter(([fileName, output]) => {
|
|
34179
|
+
return fileName.endsWith(`.${templateExtension}`) && output?.type === "asset";
|
|
34180
|
+
}).map(async ([fileName, output]) => {
|
|
34181
|
+
const source = output.source?.toString?.();
|
|
34182
|
+
if (!source) {
|
|
34183
|
+
return;
|
|
34184
|
+
}
|
|
34185
|
+
let deps = [];
|
|
34186
|
+
try {
|
|
34187
|
+
deps = scanWxml(source, { platform }).deps;
|
|
34188
|
+
} catch {
|
|
34189
|
+
return;
|
|
34190
|
+
}
|
|
34191
|
+
const absPath = path68.resolve(state.ctx.configService.absoluteSrcRoot, fileName);
|
|
34192
|
+
await handleWxsDeps.call(this, state, deps, absPath);
|
|
34193
|
+
})
|
|
34194
|
+
);
|
|
34195
|
+
}
|
|
34142
34196
|
function createWxsPlugin(state) {
|
|
34143
34197
|
const { ctx } = state;
|
|
34144
34198
|
const { wxmlService } = ctx;
|
|
34145
34199
|
return {
|
|
34146
34200
|
name: "weapp-vite:wxs",
|
|
34147
|
-
enforce: "
|
|
34201
|
+
enforce: "post",
|
|
34148
34202
|
buildStart() {
|
|
34149
34203
|
state.wxsMap.clear();
|
|
34150
34204
|
},
|
|
34151
|
-
async
|
|
34205
|
+
async generateBundle(_options, bundle) {
|
|
34206
|
+
state.wxsMap.clear();
|
|
34152
34207
|
await Promise.all(
|
|
34153
34208
|
Array.from(wxmlService.tokenMap.entries()).map(([id, token]) => {
|
|
34154
34209
|
return handleWxsDeps.call(
|
|
@@ -34160,6 +34215,7 @@ function createWxsPlugin(state) {
|
|
|
34160
34215
|
);
|
|
34161
34216
|
})
|
|
34162
34217
|
);
|
|
34218
|
+
await handleWxsDepsFromBundle.call(this, state, bundle);
|
|
34163
34219
|
for (const { emittedFile } of state.wxsMap.values()) {
|
|
34164
34220
|
this.emitFile(emittedFile);
|
|
34165
34221
|
}
|
|
@@ -37192,7 +37248,7 @@ function createScanService(ctx) {
|
|
|
37192
37248
|
vueAppPath = await findVueEntry(appBasename);
|
|
37193
37249
|
}
|
|
37194
37250
|
if (!appConfigFile && vueAppPath) {
|
|
37195
|
-
const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-
|
|
37251
|
+
const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-QH43FAOQ.mjs");
|
|
37196
37252
|
configFromVue = await extractConfigFromVue2(vueAppPath);
|
|
37197
37253
|
if (configFromVue) {
|
|
37198
37254
|
appConfigFile = vueAppPath;
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
getCompilerContext,
|
|
3
3
|
resetCompilerContext,
|
|
4
4
|
setActiveCompilerContextKey
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EE6XJ7ZZ.mjs";
|
|
6
6
|
import {
|
|
7
7
|
init_esm_shims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BP6KVMYT.mjs";
|
|
9
9
|
|
|
10
10
|
// src/createContext.ts
|
|
11
11
|
init_esm_shims();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZYRAVDNC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MP_PLATFORM,
|
|
6
6
|
SHARED_CHUNK_VIRTUAL_PREFIX,
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
normalizeMiniPlatform,
|
|
15
15
|
resolveMiniPlatform,
|
|
16
16
|
resolveWeappConfigFile
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EE6XJ7ZZ.mjs";
|
|
18
18
|
import {
|
|
19
19
|
VERSION
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DA5NTDY2.mjs";
|
|
21
21
|
import {
|
|
22
22
|
init_esm_shims
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BP6KVMYT.mjs";
|
|
24
24
|
|
|
25
25
|
// src/cli.ts
|
|
26
26
|
init_esm_shims();
|
package/dist/config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XJH7ESO6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defineAppJson,
|
|
6
6
|
defineComponentJson,
|
|
7
7
|
definePageJson,
|
|
8
8
|
defineSitemapJson,
|
|
9
9
|
defineThemeJson
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-DLO6COLF.mjs";
|
|
11
|
+
import "./chunk-BP6KVMYT.mjs";
|
|
12
12
|
export {
|
|
13
13
|
defineAppJson,
|
|
14
14
|
defineComponentJson,
|
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-GBMX636X.mjs";
|
|
2
2
|
import {
|
|
3
3
|
createCompilerContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZYRAVDNC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
defineEmits,
|
|
7
7
|
defineProps
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-BSEMCBBG.mjs";
|
|
9
|
+
import "./chunk-EE6XJ7ZZ.mjs";
|
|
10
|
+
import "./chunk-DA5NTDY2.mjs";
|
|
11
11
|
import {
|
|
12
12
|
defineConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-XJH7ESO6.mjs";
|
|
14
14
|
import {
|
|
15
15
|
defineAppJson,
|
|
16
16
|
defineComponentJson,
|
|
17
17
|
definePageJson,
|
|
18
18
|
defineSitemapJson,
|
|
19
19
|
defineThemeJson
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DLO6COLF.mjs";
|
|
21
21
|
import {
|
|
22
22
|
init_esm_shims
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BP6KVMYT.mjs";
|
|
24
24
|
|
|
25
25
|
// src/index.ts
|
|
26
26
|
init_esm_shims();
|
package/dist/json.mjs
CHANGED
package/dist/runtime.mjs
CHANGED
package/dist/types.mjs
CHANGED
package/dist/volar.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.6.
|
|
4
|
+
"version": "6.6.9",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -107,17 +107,17 @@
|
|
|
107
107
|
"vite-tsconfig-paths": "^6.1.1",
|
|
108
108
|
"vue": "^3.5.28",
|
|
109
109
|
"vue-tsc": "^3.2.4",
|
|
110
|
-
"@weapp-core/init": "6.0.1",
|
|
111
|
-
"@weapp-core/logger": "3.1.0",
|
|
112
110
|
"@weapp-core/schematics": "6.0.2",
|
|
111
|
+
"@weapp-core/logger": "3.1.0",
|
|
112
|
+
"@weapp-core/init": "6.0.1",
|
|
113
113
|
"@weapp-core/shared": "3.0.1",
|
|
114
114
|
"@weapp-vite/volar": "2.0.4",
|
|
115
115
|
"@weapp-vite/web": "1.3.0",
|
|
116
|
+
"@wevu/api": "0.1.1",
|
|
116
117
|
"rolldown-require": "2.0.6",
|
|
117
118
|
"vite-plugin-performance": "2.0.1",
|
|
118
119
|
"weapp-ide-cli": "5.0.4",
|
|
119
|
-
"wevu": "6.6.
|
|
120
|
-
"@wevu/api": "0.1.1"
|
|
120
|
+
"wevu": "6.6.9"
|
|
121
121
|
},
|
|
122
122
|
"publishConfig": {
|
|
123
123
|
"access": "public",
|