weapp-vite 6.16.13 → 6.16.15
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-routes.mjs +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-CH-fflWu.mjs → createContext-C1Nfz26i.mjs} +169 -61
- package/dist/file-CJbglcnO.mjs +2 -0
- package/dist/{file-BJggrdd-.mjs → file-D191vOaJ.mjs} +1 -1
- package/dist/getInstance-D8NZ0y2Y.mjs +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +18 -18
- package/dist/file-Cnv4FhFK.mjs +0 -2
- package/dist/getInstance-CAxuHsMM.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-
|
|
1
|
+
import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-C1Nfz26i.mjs";
|
|
2
2
|
//#region src/auto-routes.ts
|
|
3
3
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
4
4
|
function createGetter(resolver) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as getDefaultIdeProjectRoot, S as createCjsConfigLoadError, T as isPathInside, _ as resolveWeappConfigFile, b as loadViteConfigFile, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as checkRuntime, w as shouldPassPlatformArgToIdeOpen, x as parseCommentJson, y as getProjectConfigFileName } from "./createContext-
|
|
1
|
+
import { C as getDefaultIdeProjectRoot, S as createCjsConfigLoadError, T as isPathInside, _ as resolveWeappConfigFile, b as loadViteConfigFile, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as checkRuntime, w as shouldPassPlatformArgToIdeOpen, x as parseCommentJson, y as getProjectConfigFileName } from "./createContext-C1Nfz26i.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
3
|
+
import { h as VERSION } from "./file-D191vOaJ.mjs";
|
|
4
4
|
import { o as resolveWeappMcpConfig, s as startWeappViteMcpServer } from "./mcp-DV3K2AVD.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
@@ -3704,7 +3704,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
3704
3704
|
}
|
|
3705
3705
|
//#endregion
|
|
3706
3706
|
//#region package.json
|
|
3707
|
-
var version = "6.16.
|
|
3707
|
+
var version = "6.16.15";
|
|
3708
3708
|
//#endregion
|
|
3709
3709
|
//#region src/cli/devHotkeys/format.ts
|
|
3710
3710
|
const FULLWIDTH_ASCII_START = 65281;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Bn as createWeappViteHostMeta, Hn as resolveWeappViteHostMeta, Ln as WEAPP_VITE_HOST_NAME, Rn as WeappViteHostMeta, Vn as isWeappViteHost, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, o as UserConfigFnObject, p as Sitemap, qn as WeappViteRuntime, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as applyWeappViteHostMeta } from "./config-CIXBpBjh.mjs";
|
|
2
|
-
export { App, Component, Page, Sitemap, Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, WeappViteConfig, WeappViteHostMeta, WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|
|
2
|
+
export { type App, type Component, type Page, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, type WeappViteConfig, WeappViteHostMeta, type WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost-BEnGeaSo.mjs";
|
|
2
2
|
import { n as configureLogger, r as logger_default } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-
|
|
3
|
+
import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-D191vOaJ.mjs";
|
|
4
4
|
import { createRequire, isBuiltin } from "node:module";
|
|
5
5
|
import path, { posix } from "pathe";
|
|
6
6
|
import path$1, { normalize, relative, win32 } from "node:path";
|
|
@@ -9788,6 +9788,7 @@ const REG_NODE_MODULES_DIR = /[\\/]node_modules[\\/]/gi;
|
|
|
9788
9788
|
const REG_COMMONJS_HELPERS = /commonjsHelpers\.js$/;
|
|
9789
9789
|
const REG_REQUEST_GLOBAL_RUNTIME_VENDOR_ID = /(?:^|[/\\])(?:@wevu[/\\]web-apis|web-apis[/\\]dist[/\\]index\.(?:m?js|cjs)|weapp-vite[/\\](?:dist[/\\]web-apis\.mjs|src[/\\](?:webApis\.ts|runtime[/\\]webApis[/\\]index\.ts)))(?:$|[?#])/;
|
|
9790
9790
|
const REG_HASHED_DIST_CHUNK_ID = /(?:^|[/\\])dist[/\\]([^/\\]+)-(\w{6,})\.(?:m?js|cjs)(?:$|[?#])/;
|
|
9791
|
+
const STABLE_HASHED_DIST_CHUNK_PRIORITY = ["src"];
|
|
9791
9792
|
function resolveSharedPathRoot(configService, sharedPathRoot) {
|
|
9792
9793
|
const absoluteSrcRoot = configService.absoluteSrcRoot;
|
|
9793
9794
|
const configuredRoot = sharedPathRoot ? path.resolve(configService.cwd, sharedPathRoot) : absoluteSrcRoot;
|
|
@@ -9898,6 +9899,8 @@ function isRequestGlobalsRuntimeModuleId(id) {
|
|
|
9898
9899
|
}
|
|
9899
9900
|
function resolveStableHashedDistChunkFileName(chunk) {
|
|
9900
9901
|
const candidateIds = [chunk.facadeModuleId, ...chunk.moduleIds ?? []].filter((id) => typeof id === "string");
|
|
9902
|
+
const matchedChunks = [];
|
|
9903
|
+
let facadeMatchedChunk;
|
|
9901
9904
|
for (const id of candidateIds) {
|
|
9902
9905
|
const cleanedAbsoluteId = normalizeSharedPathCandidate(id);
|
|
9903
9906
|
if (!path.isAbsolute(cleanedAbsoluteId)) continue;
|
|
@@ -9908,8 +9911,19 @@ function resolveStableHashedDistChunkFileName(chunk) {
|
|
|
9908
9911
|
if (!baseName || !packageToken) continue;
|
|
9909
9912
|
REG_REQUEST_GLOBAL_RUNTIME_VENDOR_ID.lastIndex = 0;
|
|
9910
9913
|
if (REG_REQUEST_GLOBAL_RUNTIME_VENDOR_ID.test(cleanedAbsoluteId) || packageToken.endsWith("web-apis")) return `weapp-vendors/request-globals-${packageToken}-${baseName}.js`;
|
|
9911
|
-
|
|
9914
|
+
const matchedChunk = {
|
|
9915
|
+
baseName,
|
|
9916
|
+
fileName: `weapp-vendors/${packageToken}-${baseName}.js`
|
|
9917
|
+
};
|
|
9918
|
+
matchedChunks.push(matchedChunk);
|
|
9919
|
+
if (id === chunk.facadeModuleId) facadeMatchedChunk = matchedChunk;
|
|
9912
9920
|
}
|
|
9921
|
+
if (facadeMatchedChunk) return facadeMatchedChunk.fileName;
|
|
9922
|
+
for (const priorityBaseName of STABLE_HASHED_DIST_CHUNK_PRIORITY) {
|
|
9923
|
+
const matched = matchedChunks.find((chunk) => chunk.baseName === priorityBaseName);
|
|
9924
|
+
if (matched) return matched.fileName;
|
|
9925
|
+
}
|
|
9926
|
+
if (matchedChunks[0]) return matchedChunks[0].fileName;
|
|
9913
9927
|
}
|
|
9914
9928
|
function resolveStableHashedDistChunkName(chunk) {
|
|
9915
9929
|
return resolveStableHashedDistChunkFileName(chunk)?.replace(/\.js$/, "");
|
|
@@ -10398,6 +10412,29 @@ function watchWorkers(configService, watcherService, workersDir) {
|
|
|
10398
10412
|
function shouldHandleSnapshotSidecarFile(filePath) {
|
|
10399
10413
|
return isSidecarFile(filePath);
|
|
10400
10414
|
}
|
|
10415
|
+
function createSnapshotSidecarWatchPatterns(root) {
|
|
10416
|
+
return [
|
|
10417
|
+
...configSuffixes$1.map((suffix) => path.join(root, `**/*${suffix}`)),
|
|
10418
|
+
...Array.from(watchedCssExts).map((ext) => path.join(root, `**/*${ext}`)),
|
|
10419
|
+
...Array.from(watchedTemplateExts).map((ext) => path.join(root, `**/*${ext}`)),
|
|
10420
|
+
...Array.from(watchedScriptModuleExts).map((ext) => path.join(root, `**/*${ext}`))
|
|
10421
|
+
];
|
|
10422
|
+
}
|
|
10423
|
+
function createSnapshotSidecarIgnoredMatcher(ctx) {
|
|
10424
|
+
const configService = ctx.configService;
|
|
10425
|
+
if (!configService) return;
|
|
10426
|
+
const ignoredRoots = /* @__PURE__ */ new Set();
|
|
10427
|
+
const watchRoot = normalizeFsResolvedId(configService.absoluteSrcRoot);
|
|
10428
|
+
for (const dirName of defaultIgnoredDirNames) ignoredRoots.add(normalizeFsResolvedId(path.join(configService.absoluteSrcRoot, dirName)));
|
|
10429
|
+
ignoredRoots.add(normalizeFsResolvedId(configService.outDir));
|
|
10430
|
+
if (configService.mpDistRoot) ignoredRoots.add(normalizeFsResolvedId(path.resolve(configService.cwd, configService.mpDistRoot)));
|
|
10431
|
+
return (candidate) => {
|
|
10432
|
+
const normalized = normalizeFsResolvedId(candidate);
|
|
10433
|
+
if (normalized === watchRoot) return false;
|
|
10434
|
+
for (const ignored of ignoredRoots) if (normalized === ignored || normalized.startsWith(`${ignored}/`)) return true;
|
|
10435
|
+
return false;
|
|
10436
|
+
};
|
|
10437
|
+
}
|
|
10401
10438
|
function createBuildService(ctx) {
|
|
10402
10439
|
let lastHmrSlowTipProfileCount = 0;
|
|
10403
10440
|
function createHmrProfileJsonSample(totalMs) {
|
|
@@ -10769,9 +10806,10 @@ function createBuildService(ctx) {
|
|
|
10769
10806
|
await promise;
|
|
10770
10807
|
const watcherRoot = target === "plugin" ? configService.absolutePluginRoot ?? configService.absoluteSrcRoot : "/";
|
|
10771
10808
|
if (target === "app" && !watcherService.sidecarWatcherMap.has(snapshotWatcherRoot)) {
|
|
10772
|
-
const snapshotWatcher = chokidar.watch(configService.absoluteSrcRoot, createSidecarWatchOptions(configService, {
|
|
10809
|
+
const snapshotWatcher = chokidar.watch(createSnapshotSidecarWatchPatterns(configService.absoluteSrcRoot), createSidecarWatchOptions(configService, {
|
|
10773
10810
|
persistent: true,
|
|
10774
|
-
ignoreInitial: true
|
|
10811
|
+
ignoreInitial: true,
|
|
10812
|
+
ignored: createSnapshotSidecarIgnoredMatcher(ctx)
|
|
10775
10813
|
}));
|
|
10776
10814
|
snapshotWatcher.on("all", (event, id) => {
|
|
10777
10815
|
if (!id) return;
|
|
@@ -13577,9 +13615,11 @@ function createAutoImportPlugin(state) {
|
|
|
13577
13615
|
if (!getAutoImportCandidateKind(absolutePath)) return;
|
|
13578
13616
|
if (change.event === "delete") {
|
|
13579
13617
|
autoImportService.removePotentialComponent(absolutePath);
|
|
13618
|
+
await refreshAutoImportImporters(ctx, absolutePath);
|
|
13580
13619
|
return;
|
|
13581
13620
|
}
|
|
13582
13621
|
await autoImportService.registerPotentialComponent(absolutePath);
|
|
13622
|
+
await refreshAutoImportImporters(ctx, absolutePath);
|
|
13583
13623
|
}
|
|
13584
13624
|
};
|
|
13585
13625
|
}
|
|
@@ -15760,10 +15800,11 @@ function resolvePendingEntryIds(options) {
|
|
|
15760
15800
|
const shouldExpandLayoutSharedChunks = pendingReasonSummary.includes("layout-propagation") || pendingReasonSummary.includes("layout-fallback-full");
|
|
15761
15801
|
if (shouldExpandLayoutSharedChunks) for (const chunkId of options.sharedChunkImporters.keys()) relatedChunkIds.add(chunkId);
|
|
15762
15802
|
for (const entryId of options.dirtyEntrySet) {
|
|
15763
|
-
|
|
15803
|
+
const dirtyReason = options.dirtyEntryReasons.get(entryId);
|
|
15804
|
+
if (dirtyReason !== "dependency" && dirtyReason !== "direct" && dirtyReason !== "metadata") continue;
|
|
15764
15805
|
const chunkIds = options.sharedChunksByEntry.get(entryId);
|
|
15765
15806
|
if (!chunkIds?.size) continue;
|
|
15766
|
-
for (const chunkId of chunkIds) relatedChunkIds.add(chunkId);
|
|
15807
|
+
for (const chunkId of chunkIds) if (dirtyReason === "dependency" || !options.sourceSharedChunks?.has(chunkId)) relatedChunkIds.add(chunkId);
|
|
15767
15808
|
}
|
|
15768
15809
|
if (!relatedChunkIds.size) return {
|
|
15769
15810
|
pending,
|
|
@@ -15778,17 +15819,27 @@ function resolvePendingEntryIds(options) {
|
|
|
15778
15819
|
if (importers.size <= 1 && !shouldExpandLayoutSharedChunks) continue;
|
|
15779
15820
|
let hasDependencyDrivenImporter = false;
|
|
15780
15821
|
let hasDirectDirtyImporter = false;
|
|
15822
|
+
let hasMetadataDirtyImporter = false;
|
|
15781
15823
|
for (const importer of importers) {
|
|
15782
15824
|
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "dependency") {
|
|
15783
15825
|
hasDependencyDrivenImporter = true;
|
|
15784
15826
|
continue;
|
|
15785
15827
|
}
|
|
15786
|
-
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "direct")
|
|
15787
|
-
|
|
15788
|
-
|
|
15789
|
-
|
|
15790
|
-
|
|
15828
|
+
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "direct") {
|
|
15829
|
+
hasDirectDirtyImporter = true;
|
|
15830
|
+
continue;
|
|
15831
|
+
}
|
|
15832
|
+
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "metadata") hasMetadataDirtyImporter = true;
|
|
15833
|
+
}
|
|
15834
|
+
if (!hasDependencyDrivenImporter && !hasDirectDirtyImporter && !hasMetadataDirtyImporter && !shouldExpandLayoutSharedChunks) continue;
|
|
15835
|
+
if (shouldExpandLayoutSharedChunks && !hasDependencyDrivenImporter && !hasDirectDirtyImporter && !hasMetadataDirtyImporter) expansionMode = expansionMode && expansionMode !== "dependency" ? "mixed" : "dependency";
|
|
15836
|
+
else if ([
|
|
15837
|
+
hasDependencyDrivenImporter,
|
|
15838
|
+
hasDirectDirtyImporter,
|
|
15839
|
+
hasMetadataDirtyImporter
|
|
15840
|
+
].filter(Boolean).length > 1) expansionMode = "mixed";
|
|
15791
15841
|
else if (hasDirectDirtyImporter) expansionMode = expansionMode && expansionMode !== "direct" ? "mixed" : "direct";
|
|
15842
|
+
else if (hasMetadataDirtyImporter) expansionMode = expansionMode && expansionMode !== "metadata" ? "mixed" : "metadata";
|
|
15792
15843
|
else expansionMode = expansionMode && expansionMode !== "dependency" ? "mixed" : "dependency";
|
|
15793
15844
|
for (const importer of importers) {
|
|
15794
15845
|
if (!pending.has(importer)) expandedImporters.add(importer);
|
|
@@ -18659,10 +18710,11 @@ function invalidateSharedStyleCache() {
|
|
|
18659
18710
|
const importProtocols = /^(?:https?:|data:|blob:|\/)/i;
|
|
18660
18711
|
const cssImportRE = /@(?:import|wv-keep-import)\s+(?:url\()?['"]?([^'")\s]+)['"]?\)?/gi;
|
|
18661
18712
|
function ensureCssGraph(ctx) {
|
|
18662
|
-
return ctx.runtimeState
|
|
18713
|
+
return ctx.runtimeState?.css;
|
|
18663
18714
|
}
|
|
18664
18715
|
function cleanupImporterGraph(ctx, importer) {
|
|
18665
18716
|
const graph = ensureCssGraph(ctx);
|
|
18717
|
+
if (!graph) return;
|
|
18666
18718
|
const normalizedImporter = normalizePath$1(importer);
|
|
18667
18719
|
const existingDeps = graph.importerToDependencies.get(normalizedImporter);
|
|
18668
18720
|
if (!existingDeps) return;
|
|
@@ -18676,6 +18728,7 @@ function cleanupImporterGraph(ctx, importer) {
|
|
|
18676
18728
|
}
|
|
18677
18729
|
function registerCssImports(ctx, importer, dependencies) {
|
|
18678
18730
|
const graph = ensureCssGraph(ctx);
|
|
18731
|
+
if (!graph) return;
|
|
18679
18732
|
const normalizedImporter = normalizePath$1(importer);
|
|
18680
18733
|
const normalizedDeps = /* @__PURE__ */ new Set();
|
|
18681
18734
|
for (const dependency of dependencies) {
|
|
@@ -18700,6 +18753,40 @@ function registerCssImports(ctx, importer, dependencies) {
|
|
|
18700
18753
|
importers.add(normalizedImporter);
|
|
18701
18754
|
}
|
|
18702
18755
|
}
|
|
18756
|
+
function addResolvedCssSpecifier(ctx, dependencies, importer, rawSpecifier) {
|
|
18757
|
+
if (!rawSpecifier) return;
|
|
18758
|
+
if (importProtocols.test(rawSpecifier)) {
|
|
18759
|
+
if (rawSpecifier.startsWith("/")) {
|
|
18760
|
+
const absolute = path.resolve(ctx.configService.absoluteSrcRoot, rawSpecifier.slice(1));
|
|
18761
|
+
dependencies.add(absolute);
|
|
18762
|
+
const ext = path.extname(absolute);
|
|
18763
|
+
if (ext) dependencies.add(absolute.slice(0, -ext.length));
|
|
18764
|
+
}
|
|
18765
|
+
return;
|
|
18766
|
+
}
|
|
18767
|
+
let specifier = rawSpecifier;
|
|
18768
|
+
if (specifier.startsWith("@/")) specifier = path.join(ctx.configService.absoluteSrcRoot, specifier.slice(2));
|
|
18769
|
+
else if (specifier === "@") specifier = ctx.configService.absoluteSrcRoot;
|
|
18770
|
+
if (specifier.startsWith("~")) specifier = specifier.slice(1);
|
|
18771
|
+
const cleaned = specifier.replace(/[?#].*$/, "");
|
|
18772
|
+
const resolved = path.resolve(path.dirname(importer), cleaned);
|
|
18773
|
+
dependencies.add(resolved);
|
|
18774
|
+
const ext = path.extname(resolved);
|
|
18775
|
+
if (!ext) dependencies.add(resolved);
|
|
18776
|
+
else dependencies.add(resolved.slice(0, -ext.length));
|
|
18777
|
+
}
|
|
18778
|
+
function collectCssDependenciesFromContent(ctx, importer, cssContent) {
|
|
18779
|
+
cssImportRE.lastIndex = 0;
|
|
18780
|
+
const dependencies = /* @__PURE__ */ new Set();
|
|
18781
|
+
while (true) {
|
|
18782
|
+
const match = cssImportRE.exec(cssContent);
|
|
18783
|
+
if (!match) break;
|
|
18784
|
+
const rawSpecifier = match[1]?.trim();
|
|
18785
|
+
if (!rawSpecifier) continue;
|
|
18786
|
+
addResolvedCssSpecifier(ctx, dependencies, importer, rawSpecifier);
|
|
18787
|
+
}
|
|
18788
|
+
return dependencies;
|
|
18789
|
+
}
|
|
18703
18790
|
async function extractCssImportDependencies(ctx, importer) {
|
|
18704
18791
|
try {
|
|
18705
18792
|
if (!(await fs$1.promises.stat(importer)).isFile()) {
|
|
@@ -18717,38 +18804,19 @@ async function extractCssImportDependencies(ctx, importer) {
|
|
|
18717
18804
|
cleanupImporterGraph(ctx, importer);
|
|
18718
18805
|
return;
|
|
18719
18806
|
}
|
|
18720
|
-
|
|
18807
|
+
registerCssImports(ctx, importer, collectCssDependenciesFromContent(ctx, importer, cssContent));
|
|
18808
|
+
}
|
|
18809
|
+
function syncVueSfcStyleDependencies(ctx, filename, styleBlocks) {
|
|
18721
18810
|
const dependencies = /* @__PURE__ */ new Set();
|
|
18722
|
-
const
|
|
18723
|
-
|
|
18724
|
-
|
|
18725
|
-
if (!match) break;
|
|
18726
|
-
const rawSpecifier = match[1]?.trim();
|
|
18727
|
-
if (!rawSpecifier) continue;
|
|
18728
|
-
if (importProtocols.test(rawSpecifier)) {
|
|
18729
|
-
if (rawSpecifier.startsWith("/")) {
|
|
18730
|
-
const absolute = path.resolve(ctx.configService.absoluteSrcRoot, rawSpecifier.slice(1));
|
|
18731
|
-
dependencies.add(absolute);
|
|
18732
|
-
const ext = path.extname(absolute);
|
|
18733
|
-
if (ext) dependencies.add(absolute.slice(0, -ext.length));
|
|
18734
|
-
}
|
|
18735
|
-
continue;
|
|
18736
|
-
}
|
|
18737
|
-
let specifier = rawSpecifier;
|
|
18738
|
-
if (specifier.startsWith("@/")) specifier = path.join(ctx.configService.absoluteSrcRoot, specifier.slice(2));
|
|
18739
|
-
else if (specifier === "@") specifier = ctx.configService.absoluteSrcRoot;
|
|
18740
|
-
if (specifier.startsWith("~")) specifier = specifier.slice(1);
|
|
18741
|
-
const cleaned = specifier.replace(/[?#].*$/, "");
|
|
18742
|
-
const resolved = path.resolve(dir, cleaned);
|
|
18743
|
-
dependencies.add(resolved);
|
|
18744
|
-
const ext = path.extname(resolved);
|
|
18745
|
-
if (!ext) dependencies.add(resolved);
|
|
18746
|
-
else dependencies.add(resolved.slice(0, -ext.length));
|
|
18811
|
+
for (const block of styleBlocks ?? []) {
|
|
18812
|
+
if (block.content) for (const dependency of collectCssDependenciesFromContent(ctx, filename, block.content)) dependencies.add(dependency);
|
|
18813
|
+
if (typeof block.src === "string" && block.src.trim()) addResolvedCssSpecifier(ctx, dependencies, filename, block.src.trim());
|
|
18747
18814
|
}
|
|
18748
|
-
registerCssImports(ctx,
|
|
18815
|
+
registerCssImports(ctx, filename, dependencies);
|
|
18749
18816
|
}
|
|
18750
18817
|
function collectCssImporters(ctx, dependency) {
|
|
18751
18818
|
const graph = ensureCssGraph(ctx);
|
|
18819
|
+
if (!graph) return /* @__PURE__ */ new Set();
|
|
18752
18820
|
const normalizedDependency = normalizePath$1(dependency);
|
|
18753
18821
|
const matches = /* @__PURE__ */ new Set();
|
|
18754
18822
|
const direct = graph.dependencyToImporters.get(normalizedDependency);
|
|
@@ -18872,7 +18940,7 @@ function ensureSidecarWatcher(ctx, rootDir) {
|
|
|
18872
18940
|
const hasReverseImporters = Boolean(isTemplateFile || isScriptModuleFile) && (ctx.wxmlService?.getImporters(filePath).size ?? 0) > 0;
|
|
18873
18941
|
if (isCssFile && (event === "create" || event === "update")) extractCssImportDependencies(ctx, filePath);
|
|
18874
18942
|
const isDeleteEvent = event === "delete";
|
|
18875
|
-
if (event === "create" && ready || isDeleteEvent || event === "update" && (hasReverseImporters || isTemplateFile)) {
|
|
18943
|
+
if (event === "create" && ready || isDeleteEvent || event === "update" && (isCssFile || hasReverseImporters || isTemplateFile)) {
|
|
18876
18944
|
(async () => {
|
|
18877
18945
|
if (isTemplateFile && event !== "delete") await ctx.wxmlService?.scan(filePath);
|
|
18878
18946
|
await invalidateEntryForSidecar(ctx, filePath, event);
|
|
@@ -19028,6 +19096,10 @@ function isOutputFileChange(state, normalizedId) {
|
|
|
19028
19096
|
const normalizedOutDir = normalizeFsResolvedId(outDir);
|
|
19029
19097
|
return normalizedId === normalizedOutDir || normalizedId.startsWith(`${normalizedOutDir}/`);
|
|
19030
19098
|
}
|
|
19099
|
+
function isCurrentSubPackageFile(relativeSrc, subPackageMeta) {
|
|
19100
|
+
const root = subPackageMeta?.subPackage.root;
|
|
19101
|
+
return !root || relativeSrc === root || relativeSrc.startsWith(`${root}/`);
|
|
19102
|
+
}
|
|
19031
19103
|
async function normalizeWatchEvent(id, event) {
|
|
19032
19104
|
if (event !== "delete") return event;
|
|
19033
19105
|
for (const delayMs of ATOMIC_SAVE_RECHECK_DELAYS_MS) {
|
|
@@ -19103,13 +19175,30 @@ async function processChangedFile(state, id, event) {
|
|
|
19103
19175
|
}
|
|
19104
19176
|
}
|
|
19105
19177
|
};
|
|
19178
|
+
const markScriptDirty = (scriptId, cause) => {
|
|
19179
|
+
const normalizedScriptId = normalizeFsResolvedId(scriptId);
|
|
19180
|
+
const reason = isLayoutSourcePath(configService.relativeAbsoluteSrcRoot(normalizedScriptId)) ? "dependency" : "direct";
|
|
19181
|
+
if (reason === "dependency") affectedLayoutEntryIds.add(normalizedScriptId);
|
|
19182
|
+
else markEntryDirtyWithCause(normalizedScriptId, reason, cause);
|
|
19183
|
+
};
|
|
19184
|
+
const addCssImporterEntries = async (startId) => {
|
|
19185
|
+
const { importers, scripts } = await collectAffectedScriptsAndImporters(ctx, startId);
|
|
19186
|
+
for (const importer of importers) {
|
|
19187
|
+
const normalizedImporter = normalizeFsResolvedId(importer);
|
|
19188
|
+
if (isCurrentSubPackageFile(configService.relativeAbsoluteSrcRoot(normalizedImporter), subPackageMeta) && (loadedEntrySet.has(normalizedImporter) || resolvedEntryMap.has(normalizedImporter))) markScriptDirty(normalizedImporter, "css-importer");
|
|
19189
|
+
}
|
|
19190
|
+
for (const script of scripts) markScriptDirty(script, "css-importer");
|
|
19191
|
+
};
|
|
19106
19192
|
if (isDeletedMissingSelf) ctx.runtimeState.build.hmr.vueEntryNonJsonSignatures.delete(normalizedId);
|
|
19107
19193
|
if ((event === "create" || isDeletedMissingSelf) && isAutoRouteFile) {
|
|
19108
19194
|
if (await ctx.autoRoutesService?.handleFileChange(normalizedId, event)) dirtyReasonStats.set("auto-routes-topology", 1);
|
|
19109
19195
|
}
|
|
19110
|
-
if (event === "update" && isAppVueFile(normalizedId) && resolvedEntryMap.size)
|
|
19111
|
-
|
|
19112
|
-
|
|
19196
|
+
if (event === "update" && isAppVueFile(normalizedId) && resolvedEntryMap.size) {
|
|
19197
|
+
loadEntry?.invalidateResolveCache?.();
|
|
19198
|
+
for (const entryId of resolvedEntryMap.keys()) {
|
|
19199
|
+
if (entryId === normalizedId) continue;
|
|
19200
|
+
markEntryDirtyWithCause(entryId, "dependency", "app-shell-dependent");
|
|
19201
|
+
}
|
|
19113
19202
|
}
|
|
19114
19203
|
invalidateFileCache(normalizedId);
|
|
19115
19204
|
if (event === "update") {
|
|
@@ -19127,12 +19216,8 @@ async function processChangedFile(state, id, event) {
|
|
|
19127
19216
|
const ext = path.extname(normalizedId);
|
|
19128
19217
|
return ext ? normalizedId.slice(0, -ext.length) : normalizedId;
|
|
19129
19218
|
})());
|
|
19130
|
-
if (primaryScript.path)
|
|
19131
|
-
|
|
19132
|
-
const reason = isLayoutSourcePath(configService.relativeAbsoluteSrcRoot(primaryScriptId)) ? "dependency" : "direct";
|
|
19133
|
-
if (reason === "dependency") affectedLayoutEntryIds.add(primaryScriptId);
|
|
19134
|
-
else markEntryDirtyWithCause(primaryScriptId, reason, "sidecar-direct");
|
|
19135
|
-
}
|
|
19219
|
+
if (primaryScript.path) markScriptDirty(primaryScript.path, "sidecar-direct");
|
|
19220
|
+
else if (isStyleFile) await addCssImporterEntries(normalizedId);
|
|
19136
19221
|
}
|
|
19137
19222
|
}
|
|
19138
19223
|
if (event === "update" && isLayoutSourcePath(relativeSrc) && (loadedEntrySet.has(normalizedId) || resolvedEntryMap.has(normalizedId))) affectedLayoutEntryIds.add(normalizedId);
|
|
@@ -19155,7 +19240,7 @@ async function processChangedFile(state, id, event) {
|
|
|
19155
19240
|
for (const entryId of resolvedEntryMap.keys()) markEntryDirtyWithCause(entryId, "dependency", "layout-fallback-full");
|
|
19156
19241
|
return [...dirtyReasonStats.entries()].map(([cause, count]) => `${cause}:${count}`);
|
|
19157
19242
|
}
|
|
19158
|
-
if (!isDeletedMissingSelf && (loadedEntrySet.has(normalizedId) || declaredEntryType === "page" || declaredEntryType === "component")) {
|
|
19243
|
+
if (!isDeletedMissingSelf && isCurrentSubPackageFile(relativeSrc, subPackageMeta) && (loadedEntrySet.has(normalizedId) || declaredEntryType === "page" || declaredEntryType === "component")) {
|
|
19159
19244
|
const isJsonOnlyVueEntryUpdate = event === "update" && await isVueEntryJsonOnlyUpdate(state, normalizedId);
|
|
19160
19245
|
markEntryDirtyWithCause(normalizedId, isJsonOnlyVueEntryUpdate ? "metadata" : "direct", isJsonOnlyVueEntryUpdate ? "entry-json-only" : "entry-direct");
|
|
19161
19246
|
} else if (state.layoutEntryDependents.size && state.layoutEntryDependents.get(normalizedId)?.size) {
|
|
@@ -19168,7 +19253,7 @@ async function processChangedFile(state, id, event) {
|
|
|
19168
19253
|
markEntryDirtyWithCause(entryId, "dependency", "importer-graph");
|
|
19169
19254
|
}
|
|
19170
19255
|
}
|
|
19171
|
-
const sharedChunkAffected = collectAffectedEntriesFromSharedChunks(state, normalizedId);
|
|
19256
|
+
const sharedChunkAffected = !dirtyReasonStats.has("sidecar-direct") && !dirtyReasonStats.has("css-importer") ? collectAffectedEntriesFromSharedChunks(state, normalizedId) : /* @__PURE__ */ new Set();
|
|
19172
19257
|
if (sharedChunkAffected.size) for (const entryId of sharedChunkAffected) {
|
|
19173
19258
|
if (importerGraphAffectedEntryIds.has(entryId)) continue;
|
|
19174
19259
|
markEntryDirtyWithCause(entryId, "dependency", "shared-chunk-source");
|
|
@@ -19202,10 +19287,10 @@ async function processChangedFile(state, id, event) {
|
|
|
19202
19287
|
if (independentMeta?.watchSharedStyles !== false) invalidateSharedStyleCache();
|
|
19203
19288
|
}
|
|
19204
19289
|
}
|
|
19205
|
-
if (subPackageMeta) {
|
|
19290
|
+
if (subPackageMeta && dirtyReasonStats.size > 0) {
|
|
19206
19291
|
if (subPackageMeta.watchSharedStyles !== false) invalidateSharedStyleCache();
|
|
19207
19292
|
logger_default.success(`[${event}] ${configService.relativeCwd(normalizedId)} --[独立分包 ${subPackageMeta.subPackage.root}]`);
|
|
19208
|
-
} else if (!handledByIndependentWatcher) logger_default.success(`[${event}] ${configService.relativeCwd(normalizedId)}`);
|
|
19293
|
+
} else if (!subPackageMeta && !handledByIndependentWatcher) logger_default.success(`[${event}] ${configService.relativeCwd(normalizedId)}`);
|
|
19209
19294
|
return [...dirtyReasonStats.entries()].map(([cause, count]) => `${cause}:${count}`);
|
|
19210
19295
|
}
|
|
19211
19296
|
function createWatchChangeHook(state) {
|
|
@@ -21279,6 +21364,15 @@ async function collectFallbackPageEntryIds(configService, scanService) {
|
|
|
21279
21364
|
}
|
|
21280
21365
|
//#endregion
|
|
21281
21366
|
//#region src/plugins/vue/transform/bundle/emitFallbackPage.ts
|
|
21367
|
+
function isFallbackEntryPending(entryId, emittedEntryIds, configService) {
|
|
21368
|
+
const normalizedEntryId = removeExtensionDeep(configService.relativeOutputPath(entryId));
|
|
21369
|
+
for (const emittedEntryId of emittedEntryIds) {
|
|
21370
|
+
const normalizedEmitted = normalizeFsResolvedId(emittedEntryId);
|
|
21371
|
+
if (!normalizedEmitted) continue;
|
|
21372
|
+
if (removeExtensionDeep(configService.relativeOutputPath(normalizedEmitted)) === normalizedEntryId) return true;
|
|
21373
|
+
}
|
|
21374
|
+
return false;
|
|
21375
|
+
}
|
|
21282
21376
|
async function emitResolvedFallbackPageEntryAssets(options) {
|
|
21283
21377
|
const { source, result } = await loadFallbackPageEntryCompilation({
|
|
21284
21378
|
entryFilePath: options.entryFilePath,
|
|
@@ -21320,7 +21414,7 @@ async function emitResolvedFallbackPageEntryAssets(options) {
|
|
|
21320
21414
|
platformAssetOptions: options.platformAssetOptions
|
|
21321
21415
|
});
|
|
21322
21416
|
}
|
|
21323
|
-
async function emitFallbackPageAssets(bundle, state) {
|
|
21417
|
+
async function emitFallbackPageAssets(bundle, state, options) {
|
|
21324
21418
|
const { ctx, pluginCtx, compilationCache, reExportResolutionCache, classStyleRuntimeWarned, compileOptionsCache } = state;
|
|
21325
21419
|
const { configService, scanService } = ctx;
|
|
21326
21420
|
if (!configService || !scanService) return;
|
|
@@ -21332,6 +21426,7 @@ async function emitFallbackPageAssets(bundle, state) {
|
|
|
21332
21426
|
const { outputExtensions, templateExtension, styleExtension, jsonExtension, scriptModuleExtension, platformAssetOptions } = resolveVueBundleAssetContext(configService);
|
|
21333
21427
|
const collectedEntries = await collectFallbackPageEntryIds(configService, scanService);
|
|
21334
21428
|
for (const entryId of collectedEntries) {
|
|
21429
|
+
if (options?.emittedEntryIds && !isFallbackEntryPending(entryId, options.emittedEntryIds, configService)) continue;
|
|
21335
21430
|
const emitState = await resolveFallbackPageEmitState({
|
|
21336
21431
|
entryId,
|
|
21337
21432
|
configService,
|
|
@@ -21375,10 +21470,15 @@ function resolveVueBundleEmitState(state) {
|
|
|
21375
21470
|
state.appShell = Array.from(compilationCache.entries()).find(([filename, cached]) => {
|
|
21376
21471
|
return isAppVueFile(filename) && hasAppShellTemplate(cached.result);
|
|
21377
21472
|
}) ? resolveAppShellLayout(configService) : void 0;
|
|
21378
|
-
const
|
|
21379
|
-
|
|
21380
|
-
|
|
21381
|
-
|
|
21473
|
+
const hmrState = ctx.runtimeState?.build?.hmr;
|
|
21474
|
+
const isAppVueHmrUpdate = Boolean(configService.isDev && hmrState?.profile?.file && isAppVueFile(hmrState.profile.file));
|
|
21475
|
+
const emittedEntryIds = Boolean(configService.isDev && hmrState && !isAppVueHmrUpdate && !hmrState.didEmitAllEntries && hmrState.lastEmittedEntryIds.size > 0) && hmrState ? hmrState.lastEmittedEntryIds : void 0;
|
|
21476
|
+
return {
|
|
21477
|
+
compilationEntries: Array.from(compilationCache.entries()).filter(([id]) => {
|
|
21478
|
+
return !emittedEntryIds || emittedEntryIds.has(normalizeFsResolvedId(id));
|
|
21479
|
+
}),
|
|
21480
|
+
emittedEntryIds
|
|
21481
|
+
};
|
|
21382
21482
|
}
|
|
21383
21483
|
async function emitCompiledBundleEntries(bundle, state, compilationEntries) {
|
|
21384
21484
|
for (const [filename, cached] of compilationEntries) await emitCompiledVueEntryAssets(bundle, state, filename, cached);
|
|
@@ -21387,7 +21487,7 @@ async function emitVueBundleAssets(bundle, state) {
|
|
|
21387
21487
|
const emitState = resolveVueBundleEmitState(state);
|
|
21388
21488
|
if (!emitState) return;
|
|
21389
21489
|
await emitCompiledBundleEntries(bundle, state, emitState.compilationEntries);
|
|
21390
|
-
await emitFallbackPageAssets(bundle, state);
|
|
21490
|
+
await emitFallbackPageAssets(bundle, state, { emittedEntryIds: emitState.emittedEntryIds });
|
|
21391
21491
|
}
|
|
21392
21492
|
//#endregion
|
|
21393
21493
|
//#region src/plugins/vue/transform/plugin/shared/autoRoutes.ts
|
|
@@ -21909,6 +22009,7 @@ async function transformVueLikeFile(options) {
|
|
|
21909
22009
|
compileJsxFile
|
|
21910
22010
|
})));
|
|
21911
22011
|
if (Array.isArray(result.meta?.styleBlocks)) styleBlocksCache.set(filename, result.meta.styleBlocks);
|
|
22012
|
+
syncVueSfcStyleDependencies(ctx, filename, result.meta?.styleBlocks ?? styleBlocksCache.get(filename));
|
|
21912
22013
|
registerScopedSlotHostGenerics(ctx, result.scopedSlotComponents, parseUsingComponents(result.config));
|
|
21913
22014
|
await measureStage("finalizeCompiledResult", async () => {
|
|
21914
22015
|
await finalizeTransformCompiledResult({
|
|
@@ -22407,6 +22508,7 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
22407
22508
|
__VITE_IS_MODERN__: "false"
|
|
22408
22509
|
};
|
|
22409
22510
|
if (isDev) {
|
|
22511
|
+
const hmrWatchBuildDelay = 60;
|
|
22410
22512
|
const watchInclude = resolveMiniprogramWatchInclude({
|
|
22411
22513
|
cwd,
|
|
22412
22514
|
srcRoot,
|
|
@@ -22420,6 +22522,7 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
22420
22522
|
build: {
|
|
22421
22523
|
modulePreload: false,
|
|
22422
22524
|
watch: {
|
|
22525
|
+
buildDelay: hmrWatchBuildDelay,
|
|
22423
22526
|
exclude: [...defaultExcluded, mpDistRoot ? path.join(cwd, mpDistRoot, "**") : path.join(cwd, "dist", "**")],
|
|
22424
22527
|
include: watchInclude
|
|
22425
22528
|
},
|
|
@@ -23400,7 +23503,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
23400
23503
|
const vueAppPath = await findVueEntry(appBasename);
|
|
23401
23504
|
let configFromVue;
|
|
23402
23505
|
if (!appConfigFile && vueAppPath) {
|
|
23403
|
-
const { extractConfigFromVue } = await import("./file-
|
|
23506
|
+
const { extractConfigFromVue } = await import("./file-CJbglcnO.mjs");
|
|
23404
23507
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
23405
23508
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
23406
23509
|
}
|
|
@@ -24568,9 +24671,14 @@ async function hasManagedTsconfigChanges$1(ctx) {
|
|
|
24568
24671
|
for (const file of files) if (await fs.readFile(file.path, "utf8").catch(() => void 0) !== file.content) return true;
|
|
24569
24672
|
return false;
|
|
24570
24673
|
}
|
|
24674
|
+
async function outputFileIfChanged(file) {
|
|
24675
|
+
if (await fs.readFile(file.path, "utf8").catch(() => void 0) === file.content) return false;
|
|
24676
|
+
await fs.outputFile(file.path, file.content, "utf8");
|
|
24677
|
+
return true;
|
|
24678
|
+
}
|
|
24571
24679
|
async function syncManagedTsconfigFiles(ctx) {
|
|
24572
24680
|
const changed = await hasManagedTsconfigChanges$1(ctx);
|
|
24573
|
-
for (const file of await createManagedTsconfigFiles(ctx)) await
|
|
24681
|
+
for (const file of await createManagedTsconfigFiles(ctx)) await outputFileIfChanged(file);
|
|
24574
24682
|
return changed;
|
|
24575
24683
|
}
|
|
24576
24684
|
async function syncManagedTsconfigBootstrapFiles(cwd) {
|
|
@@ -84,7 +84,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
84
84
|
}
|
|
85
85
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
86
86
|
try {
|
|
87
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
87
|
+
const { getCompilerContext } = await import("./getInstance-D8NZ0y2Y.mjs");
|
|
88
88
|
const compilerContext = getCompilerContext();
|
|
89
89
|
const service = compilerContext.autoRoutesService;
|
|
90
90
|
const reference = service?.getReference?.();
|
package/dist/index.d.mts
CHANGED
|
@@ -12,4 +12,4 @@ interface CreateCompilerContextOptions extends Partial<LoadConfigOptions> {
|
|
|
12
12
|
*/
|
|
13
13
|
declare function createCompilerContext(options?: CreateCompilerContextOptions): Promise<CompilerContext>;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { App, Component, ComputedDefinitions, ConfigEnv, InlineConfig, MethodDefinitions, Page, Plugin, PluginOption, Ref, ResolveWeappViteTargetOptions, ResolvedConfig, ResolvedWeappViteTarget, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatchOptions, RolldownWatcher, Sitemap, Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, ViteDevServer, WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, WeappViteConfig, WeappViteHostMeta, WeappVitePlatform, WeappViteRuntime, WeappViteTargetDescriptor, WeappViteTargetInput, WeappViteTargetKind, WebPlatform, type WevuComponentOptions, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout };
|
|
15
|
+
export { type App, type Component, type ComputedDefinitions, type ConfigEnv, type InlineConfig, type MethodDefinitions, type Page, type Plugin, type PluginOption, type Ref, ResolveWeappViteTargetOptions, type ResolvedConfig, ResolvedWeappViteTarget, type RolldownBuild, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatchOptions, type RolldownWatcher, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, type ViteDevServer, WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, type WeappViteConfig, WeappViteHostMeta, WeappVitePlatform, WeappViteRuntime, WeappViteTargetDescriptor, WeappViteTargetInput, WeappViteTargetKind, WebPlatform, type WevuComponentOptions, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-D0HkutE0.mjs";
|
|
2
2
|
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost-BEnGeaSo.mjs";
|
|
3
3
|
import { t as defineConfig } from "./config-DJjSbpNX.mjs";
|
|
4
|
-
import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-
|
|
4
|
+
import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-C1Nfz26i.mjs";
|
|
5
5
|
import { i as createWevuComponent, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-spnjzaP2.mjs";
|
|
6
6
|
export { WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout };
|
package/dist/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-CIXBpBjh.mjs";
|
|
2
|
-
export { App, Component, Page, Sitemap, Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
|
2
|
+
export { type App, type Component, type Page, type Sitemap, type Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
package/dist/runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { a as createWevuComponent, i as WevuComponentOptions, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-DSLk7kWi.mjs";
|
|
2
|
-
export { WevuComponentOptions, createWevuComponent, defineEmits, defineProps, setPageLayout };
|
|
2
|
+
export { type WevuComponentOptions, createWevuComponent, defineEmits, defineProps, setPageLayout };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as Resolver } from "./index-C1yQldy3.mjs";
|
|
2
2
|
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-DiEBrMtj.mjs";
|
|
3
3
|
import { $ as WeappAnalyzeBudgetConfig, $t as GenerateTemplateScope, A as Ref, An as WeappLibVueTscOptions, At as WeappVueConfig, B as BindingErrorLike, Bt as CopyGlobs, Cn as SubPackageStyleScope, Ct as WeappInjectWebRuntimeGlobalsTarget, D as MethodDefinitions, Dn as WeappLibEntryContext, Dt as WeappRouteRule, E as InlineConfig, En as WeappLibDtsOptions, Et as WeappRequestRuntimeConfig, F as RolldownPlugin, Fn as WeappManagedTypeScriptConfig, Ft as Alias, G as EntryJsonFragment, Gt as GenerateFilenamesOptions, H as BaseEntry, Ht as GenerateDirsOptions, I as RolldownPluginOption, In as WeappWebConfig, It as AliasOptions, J as ScanComponentItem, Jt as GenerateTemplateContext, K as PageEntry, Kt as GenerateOptions, L as RolldownWatchOptions, Lt as AlipayNpmMode, M as RolldownBuild, Mn as WeappManagedNodeTsconfigConfig, Mt as WeappWebRuntimeConfig, N as RolldownOptions, Nn as WeappManagedServerTsconfigConfig, Nt as WeappWevuConfig, O as Plugin, On as WeappLibFileName, Ot as WeappRouteRules, P as RolldownOutput, Pn as WeappManagedSharedTsconfigConfig, Pt as WeappWorkerConfig, Q as UserConfig, Qt as GenerateTemplateInlineSource, R as RolldownWatcher, Rn as WeappViteHostMeta, Rt as BuildNpmPackageMeta, Sn as SubPackageStyleEntry, St as WeappInjectWebRuntimeGlobalsConfig, T as ConfigEnv, Tn as WeappLibConfig, Tt as WeappNpmConfig, U as ComponentEntry, Ut as GenerateExtensionsOptions, V as AppEntry, Vt as CopyOptions, W as Entry, Wt as GenerateFileType, X as ProjectConfig, Xt as GenerateTemplateFactory, Y as WxmlDep, Yt as GenerateTemplateEntry, Z as SubPackageMetaValue, Zt as GenerateTemplateFileSource, _n as SharedChunkOverride, _t as WeappAutoRoutesIncludePattern, an as JsonMergeStage, at as WeappViteConfig, b as ChangeEvent, bn as SubPackageStyleConfigEntry, bt as WeappInjectRequestGlobalsTarget, cn as NpmBuildOptions, ct as EnhanceOptions, dn as NpmPluginPackageConfig, dt as MultiPlatformConfig, en as GenerateTemplatesConfig, et as WeappAnalyzeConfig, fn as NpmStrategy, ft as ScanWxmlOptions, gn as SharedChunkMode, gt as WeappAutoRoutesInclude, hn as SharedChunkDynamicImports, ht as WeappAutoRoutesConfig, in as JsonMergeFunction, it as WeappForwardConsoleLogLevel, j as ResolvedConfig, jn as WeappManagedAppTsconfigConfig, jt as WeappVueTemplateConfig, k as PluginOption, kn as WeappLibInternalDtsOptions, kt as WeappSubPackageConfig, ln as NpmDependencyPattern, lt as EnhanceWxmlOptions, mn as ResolvedAlias, mt as WeappAppPreludeMode, nn as JsonConfig, nt as WeappDebugConfig, on as JsonMergeStrategy, ot as AutoImportComponents, pn as NpmSubPackageConfig, pt as WeappAppPreludeConfig, q as ComponentsMap, qn as WeappViteRuntime, qt as GenerateTemplate, rn as JsonMergeContext, rt as WeappForwardConsoleConfig, sn as MpPlatform, st as AutoImportComponentsOption, tn as JsFormat, tt as WeappAnalyzeHistoryConfig, un as NpmMainPackageConfig, ut as HandleWxmlOptions, vn as SharedChunkStrategy, vt as WeappHmrConfig, w as ComputedDefinitions, wn as WeappLibComponentJson, wt as WeappMcpConfig, x as WeappVitePluginApi, xn as SubPackageStyleConfigObject, xt as WeappInjectWeapiConfig, yn as SubPackage, yt as WeappInjectRequestGlobalsConfig, z as ViteDevServer, zt as ChunksConfig } from "./config-CIXBpBjh.mjs";
|
|
4
|
-
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, ComputedDefinitions, ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmDependencyPattern, NpmMainPackageConfig, NpmPluginPackageConfig, NpmStrategy, NpmSubPackageConfig, PageEntry, Plugin, PluginOption, ProjectConfig, Ref, ResolvedAlias, ResolvedConfig, Resolver, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatchOptions, RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, ViteDevServer, WeappAnalyzeBudgetConfig, WeappAnalyzeConfig, WeappAnalyzeHistoryConfig, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappInjectWebRuntimeGlobalsConfig, WeappInjectWebRuntimeGlobalsTarget, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappRequestRuntimeConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappViteConfig, WeappViteHostMeta, WeappVitePluginApi, WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWebRuntimeConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
|
|
4
|
+
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, type ComputedDefinitions, type ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, type InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, type MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmDependencyPattern, NpmMainPackageConfig, NpmPluginPackageConfig, NpmStrategy, NpmSubPackageConfig, PageEntry, type Plugin, type PluginOption, ProjectConfig, type Ref, ResolvedAlias, type ResolvedConfig, type Resolver, type RolldownBuild, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatchOptions, type RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, type ViteDevServer, WeappAnalyzeBudgetConfig, WeappAnalyzeConfig, WeappAnalyzeHistoryConfig, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappInjectWebRuntimeGlobalsConfig, WeappInjectWebRuntimeGlobalsTarget, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappRequestRuntimeConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappViteConfig, type WeappViteHostMeta, WeappVitePluginApi, type WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWebRuntimeConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.16.
|
|
4
|
+
"version": "6.16.15",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@jridgewell/remapping": "^2.3.5",
|
|
94
94
|
"@vercel/detect-agent": "^1.2.3",
|
|
95
95
|
"@volar/typescript": "^2.4.28",
|
|
96
|
-
"@vue/language-core": "^3.2.
|
|
96
|
+
"@vue/language-core": "^3.2.9",
|
|
97
97
|
"cac": "^7.0.0",
|
|
98
98
|
"chokidar": "^5.0.0",
|
|
99
99
|
"comment-json": "^5.0.0",
|
|
@@ -104,42 +104,42 @@
|
|
|
104
104
|
"magic-string": "^0.30.21",
|
|
105
105
|
"merge": "^2.1.1",
|
|
106
106
|
"obug": "^2.1.1",
|
|
107
|
-
"p-queue": "^9.
|
|
107
|
+
"p-queue": "^9.3.0",
|
|
108
108
|
"package-manager-detector": "^1.6.0",
|
|
109
109
|
"pathe": "^2.0.3",
|
|
110
110
|
"picomatch": "^4.0.4",
|
|
111
111
|
"postcss": "^8.5.14",
|
|
112
|
-
"rolldown": "1.0.
|
|
113
|
-
"rolldown-plugin-dts": "0.25.
|
|
112
|
+
"rolldown": "1.0.1",
|
|
113
|
+
"rolldown-plugin-dts": "0.25.1",
|
|
114
114
|
"semver": "^7.8.0",
|
|
115
115
|
"typescript": "^6.0.3",
|
|
116
|
-
"vite": "8.0.
|
|
116
|
+
"vite": "8.0.13",
|
|
117
117
|
"vite-tsconfig-paths": "^6.1.1",
|
|
118
118
|
"vue": "^3.5.34",
|
|
119
|
-
"vue-tsc": "^3.2.
|
|
120
|
-
"@weapp-core/init": "6.0.8",
|
|
119
|
+
"vue-tsc": "^3.2.9",
|
|
121
120
|
"@weapp-core/constants": "^0.1.7",
|
|
122
|
-
"@weapp-core/
|
|
123
|
-
"@weapp-core/schematics": "6.0.4",
|
|
121
|
+
"@weapp-core/init": "6.0.8",
|
|
124
122
|
"@weapp-core/logger": "3.1.1",
|
|
125
|
-
"@weapp-
|
|
123
|
+
"@weapp-core/schematics": "6.0.4",
|
|
124
|
+
"@weapp-core/shared": "3.0.4",
|
|
125
|
+
"@weapp-vite/ast": "6.16.15",
|
|
126
|
+
"@weapp-vite/mcp": "1.3.3",
|
|
126
127
|
"@weapp-vite/miniprogram-automator": "1.1.1",
|
|
127
|
-
"@weapp-vite/web": "1.3.20",
|
|
128
128
|
"@weapp-vite/volar": "2.1.0",
|
|
129
|
-
"
|
|
130
|
-
"@wevu/
|
|
131
|
-
"@wevu/
|
|
129
|
+
"@weapp-vite/web": "1.3.21",
|
|
130
|
+
"@wevu/api": "0.2.9",
|
|
131
|
+
"@wevu/web-apis": "1.2.13",
|
|
132
|
+
"rolldown-require": "2.0.16",
|
|
132
133
|
"vite-plugin-performance": "2.0.1",
|
|
133
134
|
"weapp-ide-cli": "5.2.10",
|
|
134
|
-
"wevu": "6.16.
|
|
135
|
-
"@weapp-vite/mcp": "1.3.3"
|
|
135
|
+
"wevu": "6.16.15"
|
|
136
136
|
},
|
|
137
137
|
"publishConfig": {
|
|
138
138
|
"access": "public",
|
|
139
139
|
"registry": "https://registry.npmjs.org"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"oxc-parser": "^0.
|
|
142
|
+
"oxc-parser": "^0.131.0",
|
|
143
143
|
"oxc-walker": "^1.0.0",
|
|
144
144
|
"tailwindcss": "^4.3.0",
|
|
145
145
|
"ts-morph": "^28.0.0"
|
package/dist/file-Cnv4FhFK.mjs
DELETED