weapp-vite 7.1.2 → 7.1.3
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-presets/wevu-router.d.mts +2 -0
- package/dist/auto-import-presets/wevu-router.mjs +2 -0
- package/dist/auto-import-presets/wevu.d.mts +2 -0
- package/dist/auto-import-presets/wevu.mjs +2 -0
- package/dist/auto-import-presets.d.mts +3 -0
- package/dist/auto-import-presets.mjs +3 -0
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/{config-CgTp6kSh.d.mts → config-D9e7hCm1.d.mts} +5 -0
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-BYZnlk4j.mjs → createContext-2OomMtxv.mjs} +180 -66
- package/dist/file-BNDoQN7z.mjs +2 -0
- package/dist/{file-CLo_LdAz.mjs → file-CD9gXASh.mjs} +1 -1
- package/dist/getInstance-ChNOSsDp.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/mcp.d.mts +1 -1
- package/dist/test.mjs +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/wevu-C4KEC5kO.d.mts +5 -0
- package/dist/wevu-CrDVekb9.mjs +130 -0
- package/dist/wevu-router-Bl-FE8zi.mjs +15 -0
- package/dist/wevu-router-Cg2sIkIE.d.mts +5 -0
- package/package.json +39 -27
- package/dist/file-BRQqRekU.mjs +0 -2
- package/dist/getInstance-D82nepOm.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getCompilerContext, y as getRouteRuntimeGlobalKeys } from "./createContext-
|
|
1
|
+
import { n as getCompilerContext, y as getRouteRuntimeGlobalKeys } from "./createContext-2OomMtxv.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,5 +1,5 @@
|
|
|
1
|
-
import { A as getDefaultIdeProjectRoot, C as collectPreloadPages, D as loadViteConfigFile, E as suggestPreloadRules, M as isPathInside, O as createCjsConfigLoadError, S as getProjectConfigFileName, T as resolvePreloadPackageIdentifier, _ as SHARED_CHUNK_VIRTUAL_PREFIX, a as createGlassEaselAnalyzeResult, b as resolveWeappConfigFile, f as getBackendForCapability, g as createSharedBuildConfig, h as syncManagedTsconfigBootstrapFiles, j as shouldPassPlatformArgToIdeOpen, k as parseCommentJson, m as syncProjectSupportFiles, o as formatBytes, p as resolveBackendExecution, t as createCompilerContext, v as resolveHmrProfileJsonPath, w as findPreloadRuleKey, x as checkRuntime } from "./createContext-
|
|
2
|
-
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-
|
|
1
|
+
import { A as getDefaultIdeProjectRoot, C as collectPreloadPages, D as loadViteConfigFile, E as suggestPreloadRules, M as isPathInside, O as createCjsConfigLoadError, S as getProjectConfigFileName, T as resolvePreloadPackageIdentifier, _ as SHARED_CHUNK_VIRTUAL_PREFIX, a as createGlassEaselAnalyzeResult, b as resolveWeappConfigFile, f as getBackendForCapability, g as createSharedBuildConfig, h as syncManagedTsconfigBootstrapFiles, j as shouldPassPlatformArgToIdeOpen, k as parseCommentJson, m as syncProjectSupportFiles, o as formatBytes, p as resolveBackendExecution, t as createCompilerContext, v as resolveHmrProfileJsonPath, w as findPreloadRuleKey, x as checkRuntime } from "./createContext-2OomMtxv.mjs";
|
|
2
|
+
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-CD9gXASh.mjs";
|
|
3
3
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
4
4
|
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-BG6TliEg.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -5062,7 +5062,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
5062
5062
|
}
|
|
5063
5063
|
//#endregion
|
|
5064
5064
|
//#region package.json
|
|
5065
|
-
var version = "7.1.
|
|
5065
|
+
var version = "7.1.3";
|
|
5066
5066
|
//#endregion
|
|
5067
5067
|
//#region src/cli/devHotkeys/format.ts
|
|
5068
5068
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -1677,6 +1677,10 @@ interface AutoRoutesCandidateState {
|
|
|
1677
1677
|
hasTemplate: boolean;
|
|
1678
1678
|
jsonPath?: string;
|
|
1679
1679
|
}
|
|
1680
|
+
interface VueEntryStyleBindings {
|
|
1681
|
+
sources: string[];
|
|
1682
|
+
expressions?: string[];
|
|
1683
|
+
}
|
|
1680
1684
|
interface LibEntryState {
|
|
1681
1685
|
name: string;
|
|
1682
1686
|
input: string;
|
|
@@ -1735,6 +1739,7 @@ interface RuntimeState {
|
|
|
1735
1739
|
entriesMap: Map<string, Entry | undefined>;
|
|
1736
1740
|
vueEntryHasTemplate: Map<string, boolean>;
|
|
1737
1741
|
vueEntrySfcSignatures: Map<string, VueSfcBlockSignatures>;
|
|
1742
|
+
vueEntryStyleBindings: Map<string, VueEntryStyleBindings>;
|
|
1738
1743
|
vueEntryTailwindContentSignatures: Map<string, string>;
|
|
1739
1744
|
vueEntryTailwindTemplateContentSignatures: Map<string, string>;
|
|
1740
1745
|
vueEntryTailwindScriptContentSignatures: Map<string, string>;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as applyWeappViteHostMeta, Qn as WeappViteHostMeta, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, er as createWeappViteHostMeta, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, ot as WeappViteConfig, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-
|
|
1
|
+
import { $n as applyWeappViteHostMeta, Qn as WeappViteHostMeta, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, er as createWeappViteHostMeta, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, ot as WeappViteConfig, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-D9e7hCm1.mjs";
|
|
2
2
|
import { t as WeappI18nConfig } from "./types-CgZn5X6j.mjs";
|
|
3
3
|
export { type App, type Component, type Page, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, type WeappI18nConfig, type WeappViteConfig, WeappViteHostMeta, type WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost--CaeyWpA.mjs";
|
|
2
|
-
import { E as MINI_PROGRAM_PLATFORM_ADAPTERS, _ as templateExtensions, a as findJsonEntry, b as isNativeTemplateSource, c as isJsOrTs, d as touch, g as supportedCssLangs, h as scriptExtensions, i as findJsEntry, l as isTemplate, m as jsExtensions, n as changeFileExtension, o as findTemplateEntry, p as configExtensions, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as vueExtensions, w as inlineAutoRoutesImports, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-
|
|
2
|
+
import { E as MINI_PROGRAM_PLATFORM_ADAPTERS, _ as templateExtensions, a as findJsonEntry, b as isNativeTemplateSource, c as isJsOrTs, d as touch, g as supportedCssLangs, h as scriptExtensions, i as findJsEntry, l as isTemplate, m as jsExtensions, n as changeFileExtension, o as findTemplateEntry, p as configExtensions, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as vueExtensions, w as inlineAutoRoutesImports, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-CD9gXASh.mjs";
|
|
3
3
|
import { n as configureLogger, r as logger_default } from "./logger-mt4mSTqV.mjs";
|
|
4
4
|
import { createRequire, isBuiltin } from "node:module";
|
|
5
5
|
import { createDebug } from "obug";
|
|
@@ -10229,6 +10229,73 @@ async function createDevModuleGraphProvider(ctx, buildConfig, onChange) {
|
|
|
10229
10229
|
} };
|
|
10230
10230
|
}
|
|
10231
10231
|
//#endregion
|
|
10232
|
+
//#region src/plugins/utils/vueSfc.ts
|
|
10233
|
+
function createSfcResolveSrcOptions(pluginCtx, configService) {
|
|
10234
|
+
return {
|
|
10235
|
+
resolveId: async (source, importer) => {
|
|
10236
|
+
if (typeof pluginCtx.resolve !== "function") return;
|
|
10237
|
+
return (await pluginCtx.resolve(source, importer))?.id;
|
|
10238
|
+
},
|
|
10239
|
+
checkMtime: getSfcCheckMtime(configService)
|
|
10240
|
+
};
|
|
10241
|
+
}
|
|
10242
|
+
function createReadAndParseSfcOptions(pluginCtx, configService, options) {
|
|
10243
|
+
const resolveCheckMtime = getSfcCheckMtime(configService);
|
|
10244
|
+
return {
|
|
10245
|
+
source: options?.source,
|
|
10246
|
+
checkMtime: options?.checkMtime ?? resolveCheckMtime,
|
|
10247
|
+
resolveSrc: createSfcResolveSrcOptions(pluginCtx, configService)
|
|
10248
|
+
};
|
|
10249
|
+
}
|
|
10250
|
+
//#endregion
|
|
10251
|
+
//#region src/plugins/vue/transform/styleOnly.ts
|
|
10252
|
+
function hasCssModules(styleBlocks) {
|
|
10253
|
+
return styleBlocks?.some((styleBlock) => Boolean(styleBlock.module)) === true;
|
|
10254
|
+
}
|
|
10255
|
+
function hasSameStyleSources(previous, current) {
|
|
10256
|
+
return !previous?.some((block, index) => block.src !== current[index]?.src) && !current.some((block, index) => block.src !== previous?.[index]?.src);
|
|
10257
|
+
}
|
|
10258
|
+
function hasSameCssVars(previous, current) {
|
|
10259
|
+
if (!previous || !current || previous.length !== current.length) return false;
|
|
10260
|
+
return previous.every((expression, index) => expression === current[index]);
|
|
10261
|
+
}
|
|
10262
|
+
async function refreshStyleOnlyVueTransformResult(result, filename, styleBlocks, cssVars, stylePreprocessOptions) {
|
|
10263
|
+
if (!styleBlocks || hasCssModules(styleBlocks) || !hasSameCssVars(result.meta?.cssVars, cssVars) || !hasSameStyleSources(result.meta?.styleBlocks, styleBlocks)) return false;
|
|
10264
|
+
if (!styleBlocks.length) {
|
|
10265
|
+
result.style = void 0;
|
|
10266
|
+
if (result.meta) {
|
|
10267
|
+
result.meta.cssVars = cssVars;
|
|
10268
|
+
result.meta.styleBlocks = styleBlocks;
|
|
10269
|
+
}
|
|
10270
|
+
return true;
|
|
10271
|
+
}
|
|
10272
|
+
const scopedId = generateScopedId(filename);
|
|
10273
|
+
result.style = (await Promise.all(styleBlocks.map(async (styleBlock) => await compileVueStyleToWxss(styleBlock, {
|
|
10274
|
+
id: scopedId,
|
|
10275
|
+
filename,
|
|
10276
|
+
scoped: styleBlock.scoped,
|
|
10277
|
+
modules: styleBlock.module,
|
|
10278
|
+
preprocessOptions: stylePreprocessOptions?.[styleBlock.lang || "css"]
|
|
10279
|
+
})))).map((result) => result.code.trim()).filter(Boolean).join("\n\n") || void 0;
|
|
10280
|
+
if (result.meta) {
|
|
10281
|
+
result.meta.cssVars = cssVars;
|
|
10282
|
+
result.meta.styleBlocks = styleBlocks;
|
|
10283
|
+
}
|
|
10284
|
+
return true;
|
|
10285
|
+
}
|
|
10286
|
+
//#endregion
|
|
10287
|
+
//#region src/plugins/core/lifecycle/vueStyleDependency.ts
|
|
10288
|
+
/** 在原生入口发射前识别外部样式引起的脚本绑定变化。 */
|
|
10289
|
+
async function collectVueStyleScriptChanges(ctx, filename, configService) {
|
|
10290
|
+
const changedEntries = /* @__PURE__ */ new Set();
|
|
10291
|
+
for (const [entryId, bindings] of ctx.runtimeState.build.hmr.vueEntryStyleBindings) {
|
|
10292
|
+
if (!bindings.sources.some((source) => normalizeFsResolvedId(source) === filename)) continue;
|
|
10293
|
+
const { descriptor } = await readAndParseSfc(entryId, createReadAndParseSfcOptions(ctx.moduleGraphService, configService));
|
|
10294
|
+
if (!hasSameCssVars(bindings.expressions, descriptor.cssVars)) changedEntries.add(entryId);
|
|
10295
|
+
}
|
|
10296
|
+
return changedEntries;
|
|
10297
|
+
}
|
|
10298
|
+
//#endregion
|
|
10232
10299
|
//#region src/plugins/tailwindcssMarker.ts
|
|
10233
10300
|
const MANAGED_TAILWINDCSS_ENTRY_MARKER_PREFIX = ".__weapp_vite_managed_tailwindcss_entry_";
|
|
10234
10301
|
const MANAGED_TAILWINDCSS_ENTRY_MARKER_SUFFIX = "__{--weapp-vite-managed-tailwindcss-entry:1}";
|
|
@@ -11446,6 +11513,7 @@ function createRuntimeState() {
|
|
|
11446
11513
|
entriesMap: /* @__PURE__ */ new Map(),
|
|
11447
11514
|
vueEntryHasTemplate: /* @__PURE__ */ new Map(),
|
|
11448
11515
|
vueEntrySfcSignatures: /* @__PURE__ */ new Map(),
|
|
11516
|
+
vueEntryStyleBindings: /* @__PURE__ */ new Map(),
|
|
11449
11517
|
vueEntryTailwindContentSignatures: /* @__PURE__ */ new Map(),
|
|
11450
11518
|
vueEntryTailwindTemplateContentSignatures: /* @__PURE__ */ new Map(),
|
|
11451
11519
|
vueEntryTailwindScriptContentSignatures: /* @__PURE__ */ new Map(),
|
|
@@ -14939,6 +15007,21 @@ function normalizeRoute(route) {
|
|
|
14939
15007
|
}
|
|
14940
15008
|
const globalStart = `/* ${WEAPP_VITE_STATEFUL_HMR_GLOBAL_STYLE_BASENAME}:start */\n`;
|
|
14941
15009
|
const globalEnd = `\n/* ${WEAPP_VITE_STATEFUL_HMR_GLOBAL_STYLE_BASENAME}:end */\n`;
|
|
15010
|
+
const pageStyleRefreshMarkerPrefix = ".weapp-vite-stateful-hmr-style-";
|
|
15011
|
+
function pageStyleRefreshMarker(token) {
|
|
15012
|
+
return `${pageStyleRefreshMarkerPrefix}${token} { --weapp-vite-stateful-hmr-style-token: ${token}; }\n`;
|
|
15013
|
+
}
|
|
15014
|
+
function stripPageStyleRefreshMarker(source) {
|
|
15015
|
+
const markerStart = source.lastIndexOf(pageStyleRefreshMarkerPrefix);
|
|
15016
|
+
if (markerStart < 0 || !source.endsWith(" }\n")) return source;
|
|
15017
|
+
const markerEnd = source.indexOf(" {", markerStart);
|
|
15018
|
+
if (markerEnd < 0) return source;
|
|
15019
|
+
const token = source.slice(markerStart + 31, markerEnd);
|
|
15020
|
+
return /^[a-f0-9]+$/.test(token) ? source.slice(0, markerStart).replace(/\n$/, "") : source;
|
|
15021
|
+
}
|
|
15022
|
+
function styleRefreshToken(source) {
|
|
15023
|
+
return createHash("sha256").update(source).digest("hex").slice(0, 16);
|
|
15024
|
+
}
|
|
14942
15025
|
function localStyleSource(source) {
|
|
14943
15026
|
if (!source.startsWith(globalStart)) return source;
|
|
14944
15027
|
const end = source.indexOf(globalEnd, globalStart.length);
|
|
@@ -14979,7 +15062,7 @@ function createStatefulHmrGlobalStyleAssets(output, styleExtension, options = {}
|
|
|
14979
15062
|
const index = result.findIndex((item) => item.fileName === fileName);
|
|
14980
15063
|
const asset = result[index];
|
|
14981
15064
|
if (asset && asset.type !== "asset") throw new Error(`Stateful HMR component page stylesheet conflicts with emitted chunk: ${fileName}`);
|
|
14982
|
-
const original = asset ? Buffer.from(asset.source).toString("utf8") : "";
|
|
15065
|
+
const original = asset ? stripPageStyleRefreshMarker(Buffer.from(asset.source).toString("utf8")) : "";
|
|
14983
15066
|
const localSource = localStyleSource(original);
|
|
14984
15067
|
const source = routes.has(route) ? globalStart + rebase(styleFile, fileName) + globalEnd + localSource : localSource;
|
|
14985
15068
|
if (asset && original === source) continue;
|
|
@@ -14992,6 +15075,22 @@ function createStatefulHmrGlobalStyleAssets(output, styleExtension, options = {}
|
|
|
14992
15075
|
if (index >= 0) result[index] = next;
|
|
14993
15076
|
else result.push(next);
|
|
14994
15077
|
}
|
|
15078
|
+
if (!options.refreshPageStyles) return result;
|
|
15079
|
+
const globalStyle = result.find((item) => item.type === "asset" && item.fileName === styleFile);
|
|
15080
|
+
const marker = pageStyleRefreshMarker(styleRefreshToken(globalStyle?.type === "asset" ? globalStyle.source : ""));
|
|
15081
|
+
for (const [index, item] of result.entries()) {
|
|
15082
|
+
if (item.type !== "asset" || path.extname(item.fileName) !== path.extname(styleFile) || item.fileName === entryFile || item.fileName === styleFile) continue;
|
|
15083
|
+
const original = Buffer.from(item.source).toString("utf8");
|
|
15084
|
+
const source = stripPageStyleRefreshMarker(original);
|
|
15085
|
+
if (!source) continue;
|
|
15086
|
+
const nextSource = `${source}${source && !source.endsWith("\n") ? "\n" : ""}${marker}`;
|
|
15087
|
+
if (original === nextSource) continue;
|
|
15088
|
+
if (result === output) result = [...output];
|
|
15089
|
+
result[index] = {
|
|
15090
|
+
...item,
|
|
15091
|
+
source: nextSource
|
|
15092
|
+
};
|
|
15093
|
+
}
|
|
14995
15094
|
return result;
|
|
14996
15095
|
}
|
|
14997
15096
|
//#endregion
|
|
@@ -17851,7 +17950,10 @@ var StatefulHmrSession = class {
|
|
|
17851
17950
|
}
|
|
17852
17951
|
const snapshot = snapshotBatch?.snapshot ?? this.initialSnapshot;
|
|
17853
17952
|
const snapshotOutput = snapshot ? this.createSnapshotAssets(snapshot) : void 0;
|
|
17854
|
-
const compatibleOutput = createStatefulHmrGlobalStyleAssets(await transformOutput(output), resolveOutputExtensions(this.ctx.configService?.outputExtensions).styleExtension, {
|
|
17953
|
+
const compatibleOutput = createStatefulHmrGlobalStyleAssets(await transformOutput(output), resolveOutputExtensions(this.ctx.configService?.outputExtensions).styleExtension, {
|
|
17954
|
+
componentPageGlobalStyleRoutes: snapshot?.componentPageGlobalStyleRoutes ?? this.componentPageGlobalStyleRoutes,
|
|
17955
|
+
refreshPageStyles: true
|
|
17956
|
+
});
|
|
17855
17957
|
if (snapshotBatch?.isSuperseded()) {
|
|
17856
17958
|
this.diagnostics?.discarded(snapshotBatch.traceBatchId, "after-transform");
|
|
17857
17959
|
return;
|
|
@@ -17911,7 +18013,7 @@ var StatefulHmrSession = class {
|
|
|
17911
18013
|
entryIds: this.entryIds
|
|
17912
18014
|
})) {
|
|
17913
18015
|
if (shouldRestartStatefulHmrServer(files, this.ctx.configService?.configFileDependencies)) this.requestServerRestart();
|
|
17914
|
-
else if (files.length > 0 && files.every(isStatefulHmrAssetFile) || shouldUseStatefulHmrSnapshotOnly(dirtyReasonSummary)) {
|
|
18016
|
+
else if (!dirtyReasonSummary.some((reason) => reason.startsWith("entry-mixed-asset:")) && (files.length > 0 && files.every(isStatefulHmrAssetFile) || shouldUseStatefulHmrSnapshotOnly(dirtyReasonSummary))) {
|
|
17915
18017
|
if (!this.snapshotScheduler.isPending()) this.requestSnapshotRefresh(files);
|
|
17916
18018
|
} else this.requestFullBuild(files);
|
|
17917
18019
|
return false;
|
|
@@ -18033,7 +18135,8 @@ var StatefulHmrSession = class {
|
|
|
18033
18135
|
return createStatefulHmrGlobalStyleAssets(snapshot.output, resolveOutputExtensions(this.ctx.configService?.outputExtensions).styleExtension, {
|
|
18034
18136
|
createIfMissing: true,
|
|
18035
18137
|
componentPageGlobalStyleRoutes: snapshot.componentPageGlobalStyleRoutes,
|
|
18036
|
-
previousComponentPageGlobalStyleRoutes: this.componentPageGlobalStyleRoutes
|
|
18138
|
+
previousComponentPageGlobalStyleRoutes: this.componentPageGlobalStyleRoutes,
|
|
18139
|
+
refreshPageStyles: true
|
|
18037
18140
|
});
|
|
18038
18141
|
}
|
|
18039
18142
|
adoptSnapshot(snapshot, output) {
|
|
@@ -18479,25 +18582,6 @@ function autoImport(ctx) {
|
|
|
18479
18582
|
return [createAutoImportPlugin({ ctx })];
|
|
18480
18583
|
}
|
|
18481
18584
|
//#endregion
|
|
18482
|
-
//#region src/plugins/utils/vueSfc.ts
|
|
18483
|
-
function createSfcResolveSrcOptions(pluginCtx, configService) {
|
|
18484
|
-
return {
|
|
18485
|
-
resolveId: async (source, importer) => {
|
|
18486
|
-
if (typeof pluginCtx.resolve !== "function") return;
|
|
18487
|
-
return (await pluginCtx.resolve(source, importer))?.id;
|
|
18488
|
-
},
|
|
18489
|
-
checkMtime: getSfcCheckMtime(configService)
|
|
18490
|
-
};
|
|
18491
|
-
}
|
|
18492
|
-
function createReadAndParseSfcOptions(pluginCtx, configService, options) {
|
|
18493
|
-
const resolveCheckMtime = getSfcCheckMtime(configService);
|
|
18494
|
-
return {
|
|
18495
|
-
source: options?.source,
|
|
18496
|
-
checkMtime: options?.checkMtime ?? resolveCheckMtime,
|
|
18497
|
-
resolveSrc: createSfcResolveSrcOptions(pluginCtx, configService)
|
|
18498
|
-
};
|
|
18499
|
-
}
|
|
18500
|
-
//#endregion
|
|
18501
18585
|
//#region src/plugins/vue/transform/usingComponentResolver.ts
|
|
18502
18586
|
const JS_LIKE_FILE_RE = /\.(?:[cm]?ts|[cm]?js)$/;
|
|
18503
18587
|
async function resolveUsingComponentReference(ctx, configService, reExportResolutionCache, importSource, importerFilename, info) {
|
|
@@ -19644,10 +19728,11 @@ function omitDeprecatedCompilerOptions(compilerOptions) {
|
|
|
19644
19728
|
}
|
|
19645
19729
|
function resolveAppWevuJsxImportSource(ctx, legacyConfig) {
|
|
19646
19730
|
const configService = requireConfigService(ctx, "解析 app JSX 类型入口前必须初始化 configService。");
|
|
19647
|
-
|
|
19731
|
+
const reactEnabled = Boolean(configService.weappViteConfig.react);
|
|
19732
|
+
if (!reactEnabled && !hasDependency(configService.packageJson, "wevu")) return;
|
|
19648
19733
|
const configuredJsxImportSource = getManagedTypeScriptConfig(ctx)?.app?.compilerOptions?.jsxImportSource;
|
|
19649
19734
|
const legacyJsxImportSource = legacyConfig?.app?.compilerOptions?.jsxImportSource;
|
|
19650
|
-
return typeof configuredJsxImportSource === "string" && configuredJsxImportSource.trim() ? configuredJsxImportSource.trim() : typeof legacyJsxImportSource === "string" && legacyJsxImportSource.trim() ? legacyJsxImportSource.trim() : resolveWevuJsxImportSource(configService.weappViteConfig.platform);
|
|
19735
|
+
return typeof configuredJsxImportSource === "string" && configuredJsxImportSource.trim() ? configuredJsxImportSource.trim() : typeof legacyJsxImportSource === "string" && legacyJsxImportSource.trim() ? legacyJsxImportSource.trim() : reactEnabled ? "react" : resolveWevuJsxImportSource(configService.weappViteConfig.platform);
|
|
19651
19736
|
}
|
|
19652
19737
|
function getAppTypes(ctx, legacyConfig) {
|
|
19653
19738
|
const config = requireConfigService(ctx, "生成 app tsconfig 前必须初始化 configService。").weappViteConfig;
|
|
@@ -19790,7 +19875,7 @@ async function createManagedTsconfigFiles(ctx) {
|
|
|
19790
19875
|
const managedDir = resolveManagedDir(ctx);
|
|
19791
19876
|
const legacyConfig = await getLegacyManagedTypeScriptConfig(ctx);
|
|
19792
19877
|
const jsxImportSource = resolveAppWevuJsxImportSource(ctx, legacyConfig);
|
|
19793
|
-
const jsxPlatformBridgeSource = isWevuJsxImportSource(jsxImportSource) && jsxImportSource !== "wevu" ? jsxImportSource : void 0;
|
|
19878
|
+
const jsxPlatformBridgeSource = isWevuJsxImportSource(jsxImportSource) && jsxImportSource !== "wevu" ? jsxImportSource : ctx.configService?.weappViteConfig.react && hasDependency(ctx.configService.packageJson, "wevu") ? resolveWevuJsxImportSource(ctx.configService.weappViteConfig.platform) : void 0;
|
|
19794
19879
|
const sharedEmptyContent = jsxPlatformBridgeSource ? [
|
|
19795
19880
|
`import type { JSX as WevuPlatformJSX } from '${jsxPlatformBridgeSource}/jsx-runtime'`,
|
|
19796
19881
|
"",
|
|
@@ -21492,16 +21577,25 @@ function createBuildService(ctx) {
|
|
|
21492
21577
|
const snapshotBuildStartedAt = performance.now();
|
|
21493
21578
|
const requiresFullRescan = batchReasons.some((batchReason) => batchReason.forceFullRescan || batchReason.event === "create" || batchReason.event === "delete");
|
|
21494
21579
|
await refreshSnapshotSources(ctx, batchReasons.flatMap((batchReason) => batchReason.file ? [batchReason.file] : []));
|
|
21580
|
+
const styleScriptChanges = /* @__PURE__ */ new Set();
|
|
21581
|
+
for (const batchReason of batchReasons) {
|
|
21582
|
+
if (!batchReason.file) continue;
|
|
21583
|
+
for (const entryId of await collectVueStyleScriptChanges(ctx, batchReason.file, configService)) {
|
|
21584
|
+
styleScriptChanges.add(entryId);
|
|
21585
|
+
graphAffectedEntries.add(entryId);
|
|
21586
|
+
}
|
|
21587
|
+
}
|
|
21495
21588
|
if (!requiresFullRescan && graphAffectedEntries.size) {
|
|
21496
21589
|
const dirtyReasons = batchReasons.map(resolveSnapshotDirtyReason);
|
|
21497
21590
|
const dirtyReason = dirtyReasons.includes("direct") ? "direct" : dirtyReasons.includes("dependency") ? "dependency" : "metadata";
|
|
21498
|
-
for (const entryId of graphAffectedEntries) if (ctx.runtimeState.build.hmr.resolvedEntryMap.has(entryId)) markSnapshotEntryDirty(entryId, reason, dirtyReason);
|
|
21591
|
+
for (const entryId of graphAffectedEntries) if (ctx.runtimeState.build.hmr.resolvedEntryMap.has(entryId)) markSnapshotEntryDirty(entryId, reason, styleScriptChanges.has(entryId) ? "direct" : dirtyReason);
|
|
21499
21592
|
const summaryCounts = /* @__PURE__ */ new Map();
|
|
21500
21593
|
for (const batchReason of batchReasons) {
|
|
21501
21594
|
if (!batchReason.file) continue;
|
|
21502
21595
|
const summary = resolveSnapshotSidecarDirtySummary(batchReason.file, graphAffectedEntriesByFile.get(normalizeFsResolvedId(batchReason.file))).replace(/:\d+$/, "");
|
|
21503
21596
|
summaryCounts.set(summary, (summaryCounts.get(summary) ?? 0) + 1);
|
|
21504
21597
|
}
|
|
21598
|
+
if (styleScriptChanges.size) summaryCounts.set("entry-mixed-asset", styleScriptChanges.size);
|
|
21505
21599
|
ctx.runtimeState.build.hmr.profile.dirtyReasonSummary = Array.from(summaryCounts, ([summary, count]) => `${summary}:${count}`);
|
|
21506
21600
|
try {
|
|
21507
21601
|
devBuildWatcher?.emitEvent({ code: "START" });
|
|
@@ -28312,7 +28406,7 @@ function rewriteStableWevuRuntimeAccess(chunk, wevuChunkFileName, aliases, usage
|
|
|
28312
28406
|
if (!aliases.size) return;
|
|
28313
28407
|
for (const [exportName, stableName] of WEVU_EXPORT_ALIASES) {
|
|
28314
28408
|
const localName = aliases.get(exportName);
|
|
28315
|
-
if (!localName) continue;
|
|
28409
|
+
if (!localName || localName === exportName) continue;
|
|
28316
28410
|
if (usage.inlineMembers.has(localName) || usage.inlineMembers.has(stableName)) replaceOutputChunkCode(chunk, /require\((`[^`]+`|'[^']+'|"[^"]+")\)\.([A-Za-z_$][\w$]*)\s*\(/g, (match) => {
|
|
28317
28411
|
const rawSpecifier = match[1];
|
|
28318
28412
|
const property = match[2];
|
|
@@ -28337,13 +28431,15 @@ function stabilizeWevuRuntimeChunkAccess(bundle, snapshot = createBundleChunkSna
|
|
|
28337
28431
|
const aliases = resolveWevuExportAliasMap(wevuChunk);
|
|
28338
28432
|
const usageByChunk = usageByRuntimeChunk.get(wevuChunk.fileName);
|
|
28339
28433
|
const importedMembers = collectImportedWevuRuntimeMembers(usageByChunk);
|
|
28434
|
+
const existingExports = collectExistingExportNames(wevuChunk.code);
|
|
28435
|
+
const missingMembers = new Set([...importedMembers].filter((name) => !existingExports.has(name)));
|
|
28340
28436
|
appendWevuRuntimeExports(wevuChunk, aliases, importedMembers);
|
|
28341
28437
|
appendSyntheticWevuHookExports(wevuChunk, importedMembers);
|
|
28342
28438
|
for (const usage of usageByChunk?.values() ?? []) {
|
|
28343
28439
|
const chunk = usage.chunk;
|
|
28344
28440
|
rewriteStableWevuRuntimeAccess(chunk, wevuChunk.fileName, aliases, usage);
|
|
28345
28441
|
if (baseChunk?.fileName) {
|
|
28346
|
-
rewriteSyntheticWevuHookAccess(chunk, wevuChunk.fileName, baseChunk.fileName,
|
|
28442
|
+
rewriteSyntheticWevuHookAccess(chunk, wevuChunk.fileName, baseChunk.fileName, missingMembers, usage);
|
|
28347
28443
|
if (chunk.code.includes(normalizeRelativeRequireSpecifier(chunk.fileName, baseChunk.fileName))) {
|
|
28348
28444
|
const nextImports = new Set(Array.isArray(chunk.imports) ? chunk.imports : []);
|
|
28349
28445
|
nextImports.add(baseChunk.fileName);
|
|
@@ -32202,7 +32298,7 @@ function createBuildEndHook(state) {
|
|
|
32202
32298
|
state.hmrState.styleSidecarFiles = styleSidecarFiles;
|
|
32203
32299
|
const affectedEntries = /* @__PURE__ */ new Set();
|
|
32204
32300
|
const causes = /* @__PURE__ */ new Map();
|
|
32205
|
-
let metadataOnly = pendingChanges.length > 0;
|
|
32301
|
+
let metadataOnly = pendingChanges.length > 0 && !state.hmrState.lastEmittedEntryIds?.size;
|
|
32206
32302
|
for (const change of pendingChanges) {
|
|
32207
32303
|
const affected = state.ctx.moduleGraphService.collectAffectedEntries(change.file);
|
|
32208
32304
|
const cause = resolveChangeCause(state, change.file, affected);
|
|
@@ -33241,7 +33337,12 @@ async function processChangedFile(state, id, event) {
|
|
|
33241
33337
|
const relativeSrc = configService.relativeAbsoluteSrcRoot(normalizedId);
|
|
33242
33338
|
const affectedLayoutEntryIds = /* @__PURE__ */ new Set();
|
|
33243
33339
|
const dirtyReasonStats = /* @__PURE__ */ new Map();
|
|
33340
|
+
let styleScriptChanges;
|
|
33244
33341
|
const markEntryDirtyWithCause = (entryId, reason, cause) => {
|
|
33342
|
+
if (styleScriptChanges?.has(entryId)) {
|
|
33343
|
+
reason = "direct";
|
|
33344
|
+
cause = "entry-mixed-asset";
|
|
33345
|
+
}
|
|
33245
33346
|
state.markEntryDirty(entryId, reason);
|
|
33246
33347
|
const isJsxTemplateDependency = reason === "dependency" && /\.(?:jsx|tsx)$/.test(normalizedId);
|
|
33247
33348
|
if (/\.(?:vue|jsx|tsx)$/.test(entryId) && (reason !== "dependency" || isJsxTemplateDependency)) {
|
|
@@ -33255,6 +33356,10 @@ async function processChangedFile(state, id, event) {
|
|
|
33255
33356
|
const isDeletedMissingSelf = event === "delete" && !await fs$1.pathExists(normalizedId);
|
|
33256
33357
|
const isAutoRouteFile = Boolean(ctx.autoRoutesService?.isRouteFile(normalizedId));
|
|
33257
33358
|
const pathKind = resolveWatchPathKind(normalizedId);
|
|
33359
|
+
if (pathKind.isStyle) {
|
|
33360
|
+
styleScriptChanges = await collectVueStyleScriptChanges(ctx, normalizedId, configService);
|
|
33361
|
+
for (const entryId of styleScriptChanges) importerGraphAffectedEntryIds.add(entryId);
|
|
33362
|
+
}
|
|
33258
33363
|
const isReactStaticTemplateUpdate = event === "update" && isReactStaticTemplateSource(configService.weappViteConfig?.react, normalizedId);
|
|
33259
33364
|
const isScriptModuleSidecar = pathKind.isScriptModuleSidecar;
|
|
33260
33365
|
const concreteChangedEntryId = isAppVueFile(normalizedId) && scanService.appEntry?.path ? normalizeFsResolvedId(scanService.appEntry.path) : normalizedId;
|
|
@@ -33308,6 +33413,7 @@ async function processChangedFile(state, id, event) {
|
|
|
33308
33413
|
if (isDeletedMissingSelf) {
|
|
33309
33414
|
ctx.runtimeState.build.hmr.vueEntryHasTemplate.delete(normalizedId);
|
|
33310
33415
|
ctx.runtimeState.build.hmr.vueEntrySfcSignatures.delete(normalizedId);
|
|
33416
|
+
ctx.runtimeState.build.hmr.vueEntryStyleBindings.delete(normalizedId);
|
|
33311
33417
|
ctx.runtimeState.build.hmr.vueEntryTailwindContentSignatures?.delete(normalizedId);
|
|
33312
33418
|
ctx.runtimeState.build.hmr.vueEntryTailwindTemplateContentSignatures?.delete(normalizedId);
|
|
33313
33419
|
ctx.runtimeState.build.hmr.vueEntryTailwindScriptContentSignatures?.delete(normalizedId);
|
|
@@ -34256,7 +34362,14 @@ function createTailwindcssPlugin(ctx) {
|
|
|
34256
34362
|
return source;
|
|
34257
34363
|
},
|
|
34258
34364
|
load(id) {
|
|
34259
|
-
if (resolved.options.generator === false ||
|
|
34365
|
+
if (resolved.options.generator === false || parseWeappVueStyleRequest(id)) return null;
|
|
34366
|
+
const sidecar = parseSidecarSourceRequest(id);
|
|
34367
|
+
if (sidecar?.dependencyOnly) return null;
|
|
34368
|
+
if (sidecar?.kind === "style" && isManagedTailwindcssEntry(ctx, sidecar.sourceId)) return {
|
|
34369
|
+
code: "export default \"\"",
|
|
34370
|
+
map: null,
|
|
34371
|
+
meta: createStyleSourceMeta([sidecar.sourceId])
|
|
34372
|
+
};
|
|
34260
34373
|
const normalizedId = normalizeManagedTailwindcssEntryPath(requestSources.get(id) ?? id.split("?")[0]);
|
|
34261
34374
|
const index = entryIndex.get(normalizedId);
|
|
34262
34375
|
if (index === void 0) return null;
|
|
@@ -35622,7 +35735,18 @@ async function finalizeTransformCompiledResult(options) {
|
|
|
35622
35735
|
const transformResult = result;
|
|
35623
35736
|
if (isApp) setAppShell?.(hasAppShellTemplate(result) ? resolveAppShellLayout(configService) : void 0);
|
|
35624
35737
|
if (!isApp) registerVueTemplateToken(ctx, filename, result.template);
|
|
35625
|
-
if (Array.isArray(result.meta?.sfcSrcDeps))
|
|
35738
|
+
if (Array.isArray(result.meta?.sfcSrcDeps)) {
|
|
35739
|
+
addNormalizedWatchFiles(pluginCtx, result.meta.sfcSrcDeps);
|
|
35740
|
+
ctx.moduleGraphService.replaceEntryDependencies(filename, "style", result.meta.sfcSrcDeps);
|
|
35741
|
+
}
|
|
35742
|
+
if (configService.isDev) {
|
|
35743
|
+
const styleBindings = ctx.runtimeState.build.hmr.vueEntryStyleBindings;
|
|
35744
|
+
if (result.meta?.sfcSrcDeps?.length) styleBindings.set(filename, {
|
|
35745
|
+
sources: result.meta.sfcSrcDeps,
|
|
35746
|
+
expressions: result.meta.cssVars
|
|
35747
|
+
});
|
|
35748
|
+
else styleBindings.delete(filename);
|
|
35749
|
+
}
|
|
35626
35750
|
const jsxDependencies = result.meta?.jsxDependencies ?? [];
|
|
35627
35751
|
addNormalizedWatchFiles(pluginCtx, jsxDependencies);
|
|
35628
35752
|
ctx.moduleGraphService.replaceEntryDependencies(filename, "jsx", jsxDependencies);
|
|
@@ -35746,27 +35870,6 @@ async function loadTransformStyleBlock(options) {
|
|
|
35746
35870
|
};
|
|
35747
35871
|
}
|
|
35748
35872
|
//#endregion
|
|
35749
|
-
//#region src/plugins/vue/transform/styleOnly.ts
|
|
35750
|
-
function hasCssModules(styleBlocks) {
|
|
35751
|
-
return styleBlocks?.some((styleBlock) => Boolean(styleBlock.module)) === true;
|
|
35752
|
-
}
|
|
35753
|
-
async function refreshStyleOnlyVueTransformResult(result, filename, styleBlocks, stylePreprocessOptions) {
|
|
35754
|
-
if (!styleBlocks || hasCssModules(styleBlocks)) return false;
|
|
35755
|
-
if (!styleBlocks.length) {
|
|
35756
|
-
result.style = void 0;
|
|
35757
|
-
return true;
|
|
35758
|
-
}
|
|
35759
|
-
const scopedId = generateScopedId(filename);
|
|
35760
|
-
result.style = (await Promise.all(styleBlocks.map(async (styleBlock) => await compileVueStyleToWxss(styleBlock, {
|
|
35761
|
-
id: scopedId,
|
|
35762
|
-
filename,
|
|
35763
|
-
scoped: styleBlock.scoped,
|
|
35764
|
-
modules: styleBlock.module,
|
|
35765
|
-
preprocessOptions: stylePreprocessOptions?.[styleBlock.lang || "css"]
|
|
35766
|
-
})))).map((result) => result.code.trim()).filter(Boolean).join("\n\n") || void 0;
|
|
35767
|
-
return true;
|
|
35768
|
-
}
|
|
35769
|
-
//#endregion
|
|
35770
35873
|
//#region src/plugins/vue/transform/bundle/shared/types.ts
|
|
35771
35874
|
function getVueBundlePageLayoutPlan(result) {
|
|
35772
35875
|
return result.meta?.pageLayoutPlan;
|
|
@@ -35881,7 +35984,7 @@ async function refreshCompiledVueEntryCacheInDev(options) {
|
|
|
35881
35984
|
source,
|
|
35882
35985
|
checkMtime: configService.isDev
|
|
35883
35986
|
});
|
|
35884
|
-
if (!await refreshStyleOnlyVueTransformResult(cached.result, filename, descriptor.styles, resolveSfcStylePreprocessOptions(configService))) cached.styleIndependentSignature = void 0;
|
|
35987
|
+
if (!await refreshStyleOnlyVueTransformResult(cached.result, filename, descriptor.styles, descriptor.cssVars, resolveSfcStylePreprocessOptions(configService))) cached.styleIndependentSignature = void 0;
|
|
35885
35988
|
else {
|
|
35886
35989
|
cached.source = source;
|
|
35887
35990
|
cached.styleIndependentSignature = currentStyleIndependentSignature;
|
|
@@ -36577,21 +36680,30 @@ function createSfcStyleBlocksSignature(styleBlocks) {
|
|
|
36577
36680
|
scoped: styleBlock.scoped
|
|
36578
36681
|
})));
|
|
36579
36682
|
}
|
|
36580
|
-
async function
|
|
36683
|
+
async function loadSfcStyleStateForStyleOnlyRefresh(options) {
|
|
36581
36684
|
const { filename, source, styleBlocksCache, force, readAndParseSfc, createReadAndParseSfcOptions, pluginCtx, configService } = options;
|
|
36582
36685
|
if (force) styleBlocksCache.delete(filename);
|
|
36583
|
-
|
|
36686
|
+
let cssVars;
|
|
36687
|
+
const styleBlocks = await preloadTransformSfcStyleBlocks({
|
|
36584
36688
|
filename,
|
|
36585
36689
|
source,
|
|
36586
36690
|
styleBlocksCache,
|
|
36587
36691
|
load: async (target, source) => {
|
|
36588
|
-
|
|
36692
|
+
const parsed = await readAndParseSfc(target, createReadAndParseSfcOptions(pluginCtx, configService, {
|
|
36589
36693
|
source,
|
|
36590
36694
|
checkMtime: configService.isDev
|
|
36591
|
-
}))
|
|
36695
|
+
}));
|
|
36696
|
+
cssVars = parsed.descriptor.cssVars;
|
|
36697
|
+
return parsed.descriptor.styles;
|
|
36592
36698
|
}
|
|
36593
36699
|
});
|
|
36594
|
-
return
|
|
36700
|
+
return {
|
|
36701
|
+
cssVars,
|
|
36702
|
+
styleBlocks
|
|
36703
|
+
};
|
|
36704
|
+
}
|
|
36705
|
+
async function loadStyleBlocksForStyleOnlyRefresh(options) {
|
|
36706
|
+
return (await loadSfcStyleStateForStyleOnlyRefresh(options)).styleBlocks;
|
|
36595
36707
|
}
|
|
36596
36708
|
//#endregion
|
|
36597
36709
|
//#region src/plugins/vue/transform/plugin/usingComponents.ts
|
|
@@ -36689,8 +36801,8 @@ async function tryReuseVueCompilation(options) {
|
|
|
36689
36801
|
const cachedResult = normalizeVueTransformResult(cachedCompilation.result);
|
|
36690
36802
|
let cachedStyleBlocks = cachedResult.meta?.styleBlocks ?? styleBlocksCache.get(filename);
|
|
36691
36803
|
let canReturnCachedCompilation = true;
|
|
36692
|
-
if (dirtyEntryId && canAttemptStyleOnlyReuse
|
|
36693
|
-
const
|
|
36804
|
+
if (filename.endsWith(".vue") && (dirtyEntryId && canAttemptStyleOnlyReuse || cachedStyleBlocks?.some((style) => Boolean(style.src)))) {
|
|
36805
|
+
const refreshedStyleState = await measureStage("loadStyleOnlySfcStyles", async () => await loadSfcStyleStateForStyleOnlyRefresh({
|
|
36694
36806
|
filename,
|
|
36695
36807
|
source,
|
|
36696
36808
|
styleBlocksCache,
|
|
@@ -36700,7 +36812,8 @@ async function tryReuseVueCompilation(options) {
|
|
|
36700
36812
|
pluginCtx,
|
|
36701
36813
|
configService
|
|
36702
36814
|
}));
|
|
36703
|
-
|
|
36815
|
+
const refreshedStyleBlocks = refreshedStyleState.styleBlocks;
|
|
36816
|
+
if (!await refreshStyleOnlyVueTransformResult(cachedResult, filename, refreshedStyleBlocks, refreshedStyleState.cssVars, resolveSfcStylePreprocessOptions(configService))) {
|
|
36704
36817
|
cachedCompilation.styleIndependentSignature = void 0;
|
|
36705
36818
|
canReturnCachedCompilation = false;
|
|
36706
36819
|
} else {
|
|
@@ -36732,7 +36845,7 @@ async function tryReuseVueCompilation(options) {
|
|
|
36732
36845
|
const currentStyleIndependentSignature = configService.isDev && dirtyEntryId && canAttemptStyleOnlyReuse && filename.endsWith(".vue") ? resolveVueSfcStyleIndependentSignature(source, filename) : void 0;
|
|
36733
36846
|
if (Boolean(configService.isDev && cachedCompilation && dirtyEntryId && canAttemptStyleOnlyReuse && filename.endsWith(".vue") && !ctx.runtimeState.scan.isDirty && cachedCompilation.autoRoutesSignature === autoRoutesSignature && cachedCompilation.styleIndependentSignature && currentStyleIndependentSignature && cachedCompilation.styleIndependentSignature === currentStyleIndependentSignature && cachedCompilation.source !== source) && cachedCompilation) {
|
|
36734
36847
|
const cachedResult = normalizeVueTransformResult(cachedCompilation.result);
|
|
36735
|
-
const
|
|
36848
|
+
const styleState = await measureStage("loadStyleOnlySfcStyles", async () => await loadSfcStyleStateForStyleOnlyRefresh({
|
|
36736
36849
|
filename,
|
|
36737
36850
|
source,
|
|
36738
36851
|
styleBlocksCache,
|
|
@@ -36742,7 +36855,8 @@ async function tryReuseVueCompilation(options) {
|
|
|
36742
36855
|
pluginCtx,
|
|
36743
36856
|
configService
|
|
36744
36857
|
}));
|
|
36745
|
-
|
|
36858
|
+
const styleBlocks = styleState.styleBlocks;
|
|
36859
|
+
if (!await refreshStyleOnlyVueTransformResult(cachedResult, filename, styleBlocks, styleState.cssVars, resolveSfcStylePreprocessOptions(configService))) cachedCompilation.styleIndependentSignature = void 0;
|
|
36746
36860
|
else {
|
|
36747
36861
|
cachedCompilation.source = source;
|
|
36748
36862
|
cachedCompilation.result = cachedResult;
|
|
@@ -38446,7 +38560,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
38446
38560
|
const { path: appEntryPath } = appEntry;
|
|
38447
38561
|
let configFromVue;
|
|
38448
38562
|
if (!appConfigFile && vueAppPath) {
|
|
38449
|
-
const { extractConfigFromVue } = await import("./file-
|
|
38563
|
+
const { extractConfigFromVue } = await import("./file-BNDoQN7z.mjs");
|
|
38450
38564
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
38451
38565
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
38452
38566
|
}
|
|
@@ -54,7 +54,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
54
54
|
}
|
|
55
55
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
56
56
|
try {
|
|
57
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
57
|
+
const { getCompilerContext } = await import("./getInstance-ChNOSsDp.mjs");
|
|
58
58
|
const compilerContext = getCompilerContext();
|
|
59
59
|
const service = compilerContext.autoRoutesService;
|
|
60
60
|
const reference = service?.getReference?.();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as applyWeappViteHostMeta, A as Ref, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Qn as WeappViteHostMeta, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, ar as WEB_PLATFORM_ALIASES, c as UserConfigFnPromise, cr as WeappViteTargetDescriptor, d as Component, dr as WebPlatform, er as createWeappViteHostMeta, f as Page, fr as getSupportedWeappVitePlatforms, g as defineComponentJson, h as defineAppJson, hr as resolveWeappViteTarget, i as UserConfigFnNoEnv, ir as ResolvedWeappViteTarget, j as ResolvedConfig, k as PluginOption, l as defineConfig, lr as WeappViteTargetInput, m as Theme, mr as isWebPlatform, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, or as WeappVitePlatform, ot as WeappViteConfig, p as Sitemap, pr as getSupportedWeappViteTargetDescriptors, r as UserConfigFn, rr as ResolveWeappViteTargetOptions, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, ur as WeappViteTargetKind, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer } from "./config-
|
|
1
|
+
import { $n as applyWeappViteHostMeta, A as Ref, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Qn as WeappViteHostMeta, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Zn as WEAPP_VITE_HOST_NAME, _ as definePageJson, a as UserConfigFnNoEnvPlain, ar as WEB_PLATFORM_ALIASES, c as UserConfigFnPromise, cr as WeappViteTargetDescriptor, d as Component, dr as WebPlatform, er as createWeappViteHostMeta, f as Page, fr as getSupportedWeappVitePlatforms, g as defineComponentJson, h as defineAppJson, hr as resolveWeappViteTarget, i as UserConfigFnNoEnv, ir as ResolvedWeappViteTarget, j as ResolvedConfig, k as PluginOption, l as defineConfig, lr as WeappViteTargetInput, m as Theme, mr as isWebPlatform, n as UserConfigExport, nr as resolveWeappViteHostMeta, o as UserConfigFnObject, or as WeappVitePlatform, ot as WeappViteConfig, p as Sitemap, pr as getSupportedWeappViteTargetDescriptors, r as UserConfigFn, rr as ResolveWeappViteTargetOptions, s as UserConfigFnObjectPlain, sr as WeappViteRuntime, t as UserConfig, tr as isWeappViteHost, u as App, ur as WeappViteTargetKind, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer } from "./config-D9e7hCm1.mjs";
|
|
2
2
|
import { t as WeappI18nConfig } from "./types-CgZn5X6j.mjs";
|
|
3
3
|
import { a as LayoutHostContext, c as LayoutHostResolver, d as unregisterLayoutHosts, f as waitForLayoutHost, i as LayoutHostBridge, l as registerLayoutHosts, m as createWevuComponent, n as defineProps, o as LayoutHostEntry, p as WevuComponentOptions, r as setPageLayout, s as LayoutHostResolveOptions, t as defineEmits, u as resolveLayoutHost } from "./runtime-Ee2HY6gR.mjs";
|
|
4
4
|
//#region src/createContext.d.ts
|
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-BL8Dhhk6.mjs";
|
|
2
2
|
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost--CaeyWpA.mjs";
|
|
3
3
|
import { t as defineConfig } from "./config-DRGcCi3h.mjs";
|
|
4
|
-
import { c as getSupportedWeappVitePlatforms, d as resolveWeappViteTarget, l as getSupportedWeappViteTargetDescriptors, s as WEB_PLATFORM_ALIASES, t as createCompilerContext, u as isWebPlatform } from "./createContext-
|
|
4
|
+
import { c as getSupportedWeappVitePlatforms, d as resolveWeappViteTarget, l as getSupportedWeappViteTargetDescriptors, s as WEB_PLATFORM_ALIASES, t as createCompilerContext, u as isWebPlatform } from "./createContext-2OomMtxv.mjs";
|
|
5
5
|
import { a as resolveLayoutHost, c as createWevuComponent, i as registerLayoutHosts, n as defineProps, o as unregisterLayoutHosts, r as setPageLayout, s as waitForLayoutHost, t as defineEmits } from "./runtime-D6VCNhNY.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, registerLayoutHosts, resolveLayoutHost, resolveWeappViteHostMeta, resolveWeappViteTarget, setPageLayout, unregisterLayoutHosts, waitForLayoutHost };
|
package/dist/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
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-
|
|
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-D9e7hCm1.mjs";
|
|
2
2
|
export { type App, type Component, type Page, type Sitemap, type Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dt as WeappMcpConfig } from "./config-
|
|
1
|
+
import { Dt as WeappMcpConfig } from "./config-D9e7hCm1.mjs";
|
|
2
2
|
import { CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_RUNTIME_REST_ENDPOINT, McpServerHandle, StartMcpServerOptions, createWeappViteMcpServer } from "@weapp-vite/mcp";
|
|
3
3
|
//#region src/mcp.d.ts
|
|
4
4
|
export interface ResolvedWeappMcpConfig {
|
package/dist/test.mjs
CHANGED
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as Resolver } from "./index-CaXAtb9e.mjs";
|
|
2
2
|
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-C7fCmf92.mjs";
|
|
3
|
-
import { $ as WeappAnalyzeBudgetConfig, $t as GenerateFileType, A as Ref, An as StyleConfigObject, At as WeappPreloadRule, B as BindingErrorLike, Bn as WeappLibDtsOptions, Bt as WeappWebRuntimeConfig, Cn as NpmSubPackageConfig, Ct as WeappInjectRequestGlobalsTarget, D as MethodDefinitions, Dn as SharedChunkOverride, Dt as WeappMcpConfig, E as InlineConfig, En as SharedChunkMode, Et as WeappInjectWebRuntimeGlobalsTarget, F as RolldownPlugin, Fn as SubPackageStyleConfigObject, Ft as WeappRouteRules, G as EntryJsonFragment, Gn as WeappManagedAppTsconfigConfig, Gt as AlipayNpmMode, H as BaseEntry, Hn as WeappLibFileName, Ht as WeappWorkerConfig, I as RolldownPluginOption, In as SubPackageStyleEntry, It as WeappSubPackageConfig, J as ScanComponentItem, Jn as WeappManagedSharedTsconfigConfig, Jt as CopyGlobs, K as PageEntry, Kn as WeappManagedNodeTsconfigConfig, Kt as BuildNpmPackageMeta, L as RolldownWatchOptions, Ln as SubPackageStyleScope, Lt as WeappUniAppConfig, M as RolldownBuild, Mn as StyleScope, Mt as WeappReactConfig, N as RolldownOptions, Nn as SubPackage, Nt as WeappRequestRuntimeConfig, O as Plugin, On as SharedChunkStrategy, Ot as WeappNpmConfig, P as RolldownOutput, Pn as SubPackageStyleConfigEntry, Pt as WeappRouteRule, Q as UserConfig, Qn as WeappViteHostMeta, Qt as GenerateExtensionsOptions, R as RolldownWatcher, Rn as WeappLibComponentJson, Rt as WeappVueConfig, Sn as NpmStrategy, St as WeappInjectRequestGlobalsConfig, T as ConfigEnv, Tn as SharedChunkDynamicImports, Tt as WeappInjectWebRuntimeGlobalsConfig, U as ComponentEntry, Un as WeappLibInternalDtsOptions, Ut as Alias, V as AppEntry, Vn as WeappLibEntryContext, Vt as WeappWevuConfig, W as Entry, Wn as WeappLibVueTscOptions, Wt as AliasOptions, X as ProjectConfig, Xn as WeappWebConfig, Xt as DeprecatedInlineDynamicImports, Y as WxmlDep, Yn as WeappManagedTypeScriptConfig, Yt as CopyOptions, Z as SubPackageMetaValue, Zt as GenerateDirsOptions, _n as NpmBuildOptions, _t as WeappAutoRoutesInclude, an as GenerateTemplateFactory, at as WeappTailwindcssOptions, b as ChangeEvent, bn as NpmPackageFilesConfig, bt as WeappBuildScopeObjectConfig, cn as GenerateTemplateScope, ct as AutoImportComponentsOption, dn as JsonConfig, dt as HandleWxmlOptions, en as GenerateFilenamesOptions, et as WeappAnalyzeConfig, fn as JsonMergeContext, ft as MultiPlatformConfig, gn as MpPlatform, gt as WeappAutoRoutesConfig, hn as JsonMergeStrategy, ht as WeappAppPreludeMode, in as GenerateTemplateEntry, it as WeappForwardConsoleLogLevel, j as ResolvedConfig, jn as StyleEntry, jt as WeappReactCompilerConfig, k as PluginOption, kn as StyleConfigEntry, kt as WeappPreloadNetwork, ln as GenerateTemplatesConfig, lt as EnhanceOptions, mn as JsonMergeStage, mt as WeappAppPreludeConfig, nn as GenerateTemplate, nt as WeappDebugConfig, on as GenerateTemplateFileSource, ot as WeappViteConfig, pn as JsonMergeFunction, pt as ScanWxmlOptions, q as ComponentsMap, qn as WeappManagedServerTsconfigConfig, qt as ChunksConfig, rn as GenerateTemplateContext, rt as WeappForwardConsoleConfig, sn as GenerateTemplateInlineSource, sr as WeappViteRuntime, st as AutoImportComponents, tn as GenerateOptions, tt as WeappAnalyzeHistoryConfig, un as JsFormat, ut as EnhanceWxmlOptions, vn as NpmDependencyPattern, vt as WeappAutoRoutesIncludePattern, w as ComputedDefinitions, wn as ResolvedAlias, wt as WeappInjectWeapiConfig, x as WeappVitePluginApi, xn as NpmPluginPackageConfig, xt as WeappHmrConfig, yn as NpmMainPackageConfig, yt as WeappBuildScopeConfig, z as ViteDevServer, zn as WeappLibConfig, zt as WeappVueTemplateConfig } from "./config-
|
|
3
|
+
import { $ as WeappAnalyzeBudgetConfig, $t as GenerateFileType, A as Ref, An as StyleConfigObject, At as WeappPreloadRule, B as BindingErrorLike, Bn as WeappLibDtsOptions, Bt as WeappWebRuntimeConfig, Cn as NpmSubPackageConfig, Ct as WeappInjectRequestGlobalsTarget, D as MethodDefinitions, Dn as SharedChunkOverride, Dt as WeappMcpConfig, E as InlineConfig, En as SharedChunkMode, Et as WeappInjectWebRuntimeGlobalsTarget, F as RolldownPlugin, Fn as SubPackageStyleConfigObject, Ft as WeappRouteRules, G as EntryJsonFragment, Gn as WeappManagedAppTsconfigConfig, Gt as AlipayNpmMode, H as BaseEntry, Hn as WeappLibFileName, Ht as WeappWorkerConfig, I as RolldownPluginOption, In as SubPackageStyleEntry, It as WeappSubPackageConfig, J as ScanComponentItem, Jn as WeappManagedSharedTsconfigConfig, Jt as CopyGlobs, K as PageEntry, Kn as WeappManagedNodeTsconfigConfig, Kt as BuildNpmPackageMeta, L as RolldownWatchOptions, Ln as SubPackageStyleScope, Lt as WeappUniAppConfig, M as RolldownBuild, Mn as StyleScope, Mt as WeappReactConfig, N as RolldownOptions, Nn as SubPackage, Nt as WeappRequestRuntimeConfig, O as Plugin, On as SharedChunkStrategy, Ot as WeappNpmConfig, P as RolldownOutput, Pn as SubPackageStyleConfigEntry, Pt as WeappRouteRule, Q as UserConfig, Qn as WeappViteHostMeta, Qt as GenerateExtensionsOptions, R as RolldownWatcher, Rn as WeappLibComponentJson, Rt as WeappVueConfig, Sn as NpmStrategy, St as WeappInjectRequestGlobalsConfig, T as ConfigEnv, Tn as SharedChunkDynamicImports, Tt as WeappInjectWebRuntimeGlobalsConfig, U as ComponentEntry, Un as WeappLibInternalDtsOptions, Ut as Alias, V as AppEntry, Vn as WeappLibEntryContext, Vt as WeappWevuConfig, W as Entry, Wn as WeappLibVueTscOptions, Wt as AliasOptions, X as ProjectConfig, Xn as WeappWebConfig, Xt as DeprecatedInlineDynamicImports, Y as WxmlDep, Yn as WeappManagedTypeScriptConfig, Yt as CopyOptions, Z as SubPackageMetaValue, Zt as GenerateDirsOptions, _n as NpmBuildOptions, _t as WeappAutoRoutesInclude, an as GenerateTemplateFactory, at as WeappTailwindcssOptions, b as ChangeEvent, bn as NpmPackageFilesConfig, bt as WeappBuildScopeObjectConfig, cn as GenerateTemplateScope, ct as AutoImportComponentsOption, dn as JsonConfig, dt as HandleWxmlOptions, en as GenerateFilenamesOptions, et as WeappAnalyzeConfig, fn as JsonMergeContext, ft as MultiPlatformConfig, gn as MpPlatform, gt as WeappAutoRoutesConfig, hn as JsonMergeStrategy, ht as WeappAppPreludeMode, in as GenerateTemplateEntry, it as WeappForwardConsoleLogLevel, j as ResolvedConfig, jn as StyleEntry, jt as WeappReactCompilerConfig, k as PluginOption, kn as StyleConfigEntry, kt as WeappPreloadNetwork, ln as GenerateTemplatesConfig, lt as EnhanceOptions, mn as JsonMergeStage, mt as WeappAppPreludeConfig, nn as GenerateTemplate, nt as WeappDebugConfig, on as GenerateTemplateFileSource, ot as WeappViteConfig, pn as JsonMergeFunction, pt as ScanWxmlOptions, q as ComponentsMap, qn as WeappManagedServerTsconfigConfig, qt as ChunksConfig, rn as GenerateTemplateContext, rt as WeappForwardConsoleConfig, sn as GenerateTemplateInlineSource, sr as WeappViteRuntime, st as AutoImportComponents, tn as GenerateOptions, tt as WeappAnalyzeHistoryConfig, un as JsFormat, ut as EnhanceWxmlOptions, vn as NpmDependencyPattern, vt as WeappAutoRoutesIncludePattern, w as ComputedDefinitions, wn as ResolvedAlias, wt as WeappInjectWeapiConfig, x as WeappVitePluginApi, xn as NpmPluginPackageConfig, xt as WeappHmrConfig, yn as NpmMainPackageConfig, yt as WeappBuildScopeConfig, z as ViteDevServer, zn as WeappLibConfig, zt as WeappVueTemplateConfig } from "./config-D9e7hCm1.mjs";
|
|
4
4
|
import { t as WeappI18nConfig } from "./types-CgZn5X6j.mjs";
|
|
5
5
|
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, type ComputedDefinitions, type ConfigEnv, CopyGlobs, CopyOptions, DeprecatedInlineDynamicImports, 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, NpmPackageFilesConfig, 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, StyleConfigEntry, StyleConfigObject, StyleEntry, StyleScope, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, type ViteDevServer, WeappAnalyzeBudgetConfig, WeappAnalyzeConfig, WeappAnalyzeHistoryConfig, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappBuildScopeConfig, WeappBuildScopeObjectConfig, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, type WeappI18nConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappInjectWebRuntimeGlobalsConfig, WeappInjectWebRuntimeGlobalsTarget, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappPreloadNetwork, WeappPreloadRule, WeappReactCompilerConfig, WeappReactConfig, WeappRequestRuntimeConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappTailwindcssOptions, WeappUniAppConfig, WeappViteConfig, type WeappViteHostMeta, WeappVitePluginApi, type WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWebRuntimeConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
//#region src/auto-import-presets/wevu.ts
|
|
2
|
+
const wevu = { wevu: [
|
|
3
|
+
"createApp",
|
|
4
|
+
"defineComponent",
|
|
5
|
+
"defineProps",
|
|
6
|
+
"withDefaults",
|
|
7
|
+
"defineEmits",
|
|
8
|
+
"defineSlots",
|
|
9
|
+
"defineExpose",
|
|
10
|
+
"defineModel",
|
|
11
|
+
"defineOptions",
|
|
12
|
+
"defineAppJson",
|
|
13
|
+
"definePageJson",
|
|
14
|
+
"defineComponentJson",
|
|
15
|
+
"defineSitemapJson",
|
|
16
|
+
"defineThemeJson",
|
|
17
|
+
"definePageMeta",
|
|
18
|
+
"defineAppSetup",
|
|
19
|
+
"ref",
|
|
20
|
+
"customRef",
|
|
21
|
+
"reactive",
|
|
22
|
+
"shallowRef",
|
|
23
|
+
"shallowReactive",
|
|
24
|
+
"readonly",
|
|
25
|
+
"shallowReadonly",
|
|
26
|
+
"computed",
|
|
27
|
+
"watch",
|
|
28
|
+
"watchEffect",
|
|
29
|
+
"watchPostEffect",
|
|
30
|
+
"watchSyncEffect",
|
|
31
|
+
"effectScope",
|
|
32
|
+
"getCurrentScope",
|
|
33
|
+
"onScopeDispose",
|
|
34
|
+
"toRef",
|
|
35
|
+
"toRefs",
|
|
36
|
+
"unref",
|
|
37
|
+
"toValue",
|
|
38
|
+
"triggerRef",
|
|
39
|
+
"toRaw",
|
|
40
|
+
"markRaw",
|
|
41
|
+
"isRef",
|
|
42
|
+
"isReactive",
|
|
43
|
+
"isShallowRef",
|
|
44
|
+
"isShallowReactive",
|
|
45
|
+
"isRaw",
|
|
46
|
+
"isReadonly",
|
|
47
|
+
"isProxy",
|
|
48
|
+
"nextTick",
|
|
49
|
+
"useAsyncDerivation",
|
|
50
|
+
"effect",
|
|
51
|
+
"stop",
|
|
52
|
+
"batch",
|
|
53
|
+
"startBatch",
|
|
54
|
+
"endBatch",
|
|
55
|
+
"traverse",
|
|
56
|
+
"onLaunch",
|
|
57
|
+
"onShow",
|
|
58
|
+
"onHide",
|
|
59
|
+
"onError",
|
|
60
|
+
"onPageNotFound",
|
|
61
|
+
"onUnhandledRejection",
|
|
62
|
+
"onThemeChange",
|
|
63
|
+
"onMemoryWarning",
|
|
64
|
+
"onLoad",
|
|
65
|
+
"onReady",
|
|
66
|
+
"onUnload",
|
|
67
|
+
"onPullDownRefresh",
|
|
68
|
+
"onReachBottom",
|
|
69
|
+
"onPageScroll",
|
|
70
|
+
"onRouteDone",
|
|
71
|
+
"onTabItemTap",
|
|
72
|
+
"onResize",
|
|
73
|
+
"onShareAppMessage",
|
|
74
|
+
"onShareTimeline",
|
|
75
|
+
"onAddToFavorites",
|
|
76
|
+
"onSaveExitState",
|
|
77
|
+
"onAttached",
|
|
78
|
+
"onDetached",
|
|
79
|
+
"onMoved",
|
|
80
|
+
"onBeforeMount",
|
|
81
|
+
"onMounted",
|
|
82
|
+
"onBeforeUpdate",
|
|
83
|
+
"onUpdated",
|
|
84
|
+
"onBeforeUnmount",
|
|
85
|
+
"onUnmounted",
|
|
86
|
+
"onActivated",
|
|
87
|
+
"onDeactivated",
|
|
88
|
+
"onErrorCaptured",
|
|
89
|
+
"onServerPrefetch",
|
|
90
|
+
"getCurrentInstance",
|
|
91
|
+
"getCurrentSetupContext",
|
|
92
|
+
"provide",
|
|
93
|
+
"inject",
|
|
94
|
+
"hasInjectionContext",
|
|
95
|
+
"provideGlobal",
|
|
96
|
+
"injectGlobal",
|
|
97
|
+
"useNativeInstance",
|
|
98
|
+
"useBindModel",
|
|
99
|
+
"useChangeModel",
|
|
100
|
+
"useIntersectionObserver",
|
|
101
|
+
"useElementIntersectionObserver",
|
|
102
|
+
"useSelectorQuery",
|
|
103
|
+
"useBoundingClientRect",
|
|
104
|
+
"useSelectorFields",
|
|
105
|
+
"useScrollOffset",
|
|
106
|
+
"useDisposables",
|
|
107
|
+
"usePageLayout",
|
|
108
|
+
"setPageLayout",
|
|
109
|
+
"usePageStack",
|
|
110
|
+
"getCurrentPageStackSnapshot",
|
|
111
|
+
"useNavigationBarMetrics",
|
|
112
|
+
"getNavigationBarMetrics",
|
|
113
|
+
"usePageScrollThrottle",
|
|
114
|
+
"useUpdatePerformanceListener",
|
|
115
|
+
"useAsyncPullDownRefresh",
|
|
116
|
+
"use",
|
|
117
|
+
"mergeModels",
|
|
118
|
+
"useModel",
|
|
119
|
+
"useAttrs",
|
|
120
|
+
"useSlots",
|
|
121
|
+
"useTemplateRef",
|
|
122
|
+
"setWevuDefaults",
|
|
123
|
+
"resetWevuDefaults",
|
|
124
|
+
"markNoSetData",
|
|
125
|
+
"isNoSetData",
|
|
126
|
+
"addMutationRecorder",
|
|
127
|
+
"removeMutationRecorder"
|
|
128
|
+
] };
|
|
129
|
+
//#endregion
|
|
130
|
+
export { wevu as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/auto-import-presets/wevu-router.ts
|
|
2
|
+
const wevuRouter = { "wevu/router": [
|
|
3
|
+
"createRouter",
|
|
4
|
+
"useRouter",
|
|
5
|
+
"useRoute",
|
|
6
|
+
"useNativeRouter",
|
|
7
|
+
"useNativePageRouter",
|
|
8
|
+
"resolveRouteLocation",
|
|
9
|
+
"parseQuery",
|
|
10
|
+
"stringifyQuery",
|
|
11
|
+
"createNavigationFailure",
|
|
12
|
+
"isNavigationFailure"
|
|
13
|
+
] };
|
|
14
|
+
//#endregion
|
|
15
|
+
export { wevuRouter as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.3",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -93,7 +93,19 @@
|
|
|
93
93
|
"types": "./client.d.ts"
|
|
94
94
|
},
|
|
95
95
|
"./package.json": "./package.json",
|
|
96
|
-
"./*": "./*"
|
|
96
|
+
"./*": "./*",
|
|
97
|
+
"./auto-import-presets": {
|
|
98
|
+
"types": "./dist/auto-import-presets.d.mts",
|
|
99
|
+
"import": "./dist/auto-import-presets.mjs"
|
|
100
|
+
},
|
|
101
|
+
"./auto-import-presets/wevu": {
|
|
102
|
+
"types": "./dist/auto-import-presets/wevu.d.mts",
|
|
103
|
+
"import": "./dist/auto-import-presets/wevu.mjs"
|
|
104
|
+
},
|
|
105
|
+
"./auto-import-presets/wevu-router": {
|
|
106
|
+
"types": "./dist/auto-import-presets/wevu-router.d.mts",
|
|
107
|
+
"import": "./dist/auto-import-presets/wevu-router.mjs"
|
|
108
|
+
}
|
|
97
109
|
},
|
|
98
110
|
"main": "./dist/index.mjs",
|
|
99
111
|
"module": "./dist/index.mjs",
|
|
@@ -123,20 +135,20 @@
|
|
|
123
135
|
"@vercel/detect-agent": "^1.2.5",
|
|
124
136
|
"@volar/typescript": "^2.4.28",
|
|
125
137
|
"@vue/language-core": "^3.3.11",
|
|
126
|
-
"@weapp-core/constants": "0.2.
|
|
127
|
-
"@weapp-core/init": "6.0.
|
|
128
|
-
"@weapp-core/logger": "3.1.
|
|
129
|
-
"@weapp-core/schematics": "6.2.
|
|
130
|
-
"@weapp-core/shared": "3.2.
|
|
131
|
-
"@weapp-vite/ast": "7.1.
|
|
132
|
-
"@weapp-vite/eslint": "0.2.
|
|
133
|
-
"@weapp-vite/i18n": "0.2.
|
|
134
|
-
"@weapp-vite/mcp": "1.5.
|
|
135
|
-
"@weapp-vite/miniprogram-automator": "1.2.
|
|
136
|
-
"@weapp-vite/volar": "2.1.
|
|
137
|
-
"@weapp-vite/web": "1.5.
|
|
138
|
-
"@wevu/api": "0.3.
|
|
139
|
-
"@wevu/web-apis": "1.
|
|
138
|
+
"@weapp-core/constants": "0.2.4",
|
|
139
|
+
"@weapp-core/init": "6.0.20",
|
|
140
|
+
"@weapp-core/logger": "3.1.4",
|
|
141
|
+
"@weapp-core/schematics": "6.2.4",
|
|
142
|
+
"@weapp-core/shared": "3.2.3",
|
|
143
|
+
"@weapp-vite/ast": "7.1.3",
|
|
144
|
+
"@weapp-vite/eslint": "0.2.5",
|
|
145
|
+
"@weapp-vite/i18n": "0.2.4",
|
|
146
|
+
"@weapp-vite/mcp": "1.5.4",
|
|
147
|
+
"@weapp-vite/miniprogram-automator": "1.2.19",
|
|
148
|
+
"@weapp-vite/volar": "2.1.8",
|
|
149
|
+
"@weapp-vite/web": "1.5.3",
|
|
150
|
+
"@wevu/api": "0.3.3",
|
|
151
|
+
"@wevu/web-apis": "1.3.0",
|
|
140
152
|
"cac": "^7.0.0",
|
|
141
153
|
"chokidar": "^5.0.0",
|
|
142
154
|
"comment-json": "^5.0.0",
|
|
@@ -144,7 +156,7 @@
|
|
|
144
156
|
"htmlparser2": "^12.0.0",
|
|
145
157
|
"local-pkg": "^1.2.1",
|
|
146
158
|
"lru-cache": "^11.5.2",
|
|
147
|
-
"magic-string": "^1.
|
|
159
|
+
"magic-string": "^1.4.1",
|
|
148
160
|
"merge": "^2.1.1",
|
|
149
161
|
"obug": "^3.0.0",
|
|
150
162
|
"p-queue": "^9.3.3",
|
|
@@ -153,25 +165,25 @@
|
|
|
153
165
|
"picomatch": "^4.0.7",
|
|
154
166
|
"postcss": "^8.5.28",
|
|
155
167
|
"postcss-value-parser": "4.2.0",
|
|
156
|
-
"rolldown": "1.2.
|
|
157
|
-
"rolldown-plugin-dts": "0.28.
|
|
158
|
-
"rolldown-require": "2.0.
|
|
168
|
+
"rolldown": "1.2.9",
|
|
169
|
+
"rolldown-plugin-dts": "0.28.6",
|
|
170
|
+
"rolldown-require": "2.0.30",
|
|
159
171
|
"semver": "^7.8.5",
|
|
160
172
|
"typescript": "^6.0.3",
|
|
161
173
|
"vite": "8.3.0",
|
|
162
|
-
"vite-plugin-performance": "2.0.
|
|
174
|
+
"vite-plugin-performance": "2.0.3",
|
|
163
175
|
"vite-tsconfig-paths": "^6.1.1",
|
|
164
|
-
"vue": "^3.5.
|
|
176
|
+
"vue": "^3.5.43",
|
|
165
177
|
"vue-tsc": "^3.3.11",
|
|
166
|
-
"weapp-ide-cli": "6.1.
|
|
167
|
-
"weapp-tailwindcss": "^5.5.
|
|
168
|
-
"wevu": "7.1.
|
|
178
|
+
"weapp-ide-cli": "6.1.5",
|
|
179
|
+
"weapp-tailwindcss": "^5.5.5",
|
|
180
|
+
"wevu": "7.1.3"
|
|
169
181
|
},
|
|
170
182
|
"optionalDependencies": {
|
|
171
183
|
"@swc/core": "^1.16.2"
|
|
172
184
|
},
|
|
173
185
|
"devDependencies": {
|
|
174
|
-
"oxc-parser": "^0.
|
|
186
|
+
"oxc-parser": "^0.150.0",
|
|
175
187
|
"oxc-walker": "^1.1.1",
|
|
176
188
|
"tailwindcss": "^4.3.3",
|
|
177
189
|
"ts-morph": "^28.0.0"
|
|
@@ -189,7 +201,7 @@
|
|
|
189
201
|
"benchmark:auto-import:ci": "node --import tsx scripts/benchmark-auto-import-ci.ts",
|
|
190
202
|
"test:dev": "vitest",
|
|
191
203
|
"test": "vitest run",
|
|
192
|
-
"test:types": "cd test-d/auto-routes-define-app-json && tsd --files \"**/*.test-d.ts\" && cd ../config-define-config && tsd --files \"**/*.test-d.ts\" && cd ../config-public-types && tsd --files \"**/*.test-d.ts\" && cd ../i18n-public-types && tsd --files \"**/*.test-d.ts\" && cd ../internal-src-types && tsd --files \"**/*.test-d.ts\" && cd ../resolvers-public-types && tsd --files \"**/*.test-d.ts\" && cd ../runtime-public-types && tsd --files \"**/*.test-d.ts\" && cd ../test-artifact-public-types && tsd --files \"**/*.test-d.ts\"",
|
|
204
|
+
"test:types": "cd test-d/auto-import-presets && tsd --files \"**/*.test-d.ts\" && cd ../auto-routes-define-app-json && tsd --files \"**/*.test-d.ts\" && cd ../config-define-config && tsd --files \"**/*.test-d.ts\" && cd ../config-public-types && tsd --files \"**/*.test-d.ts\" && cd ../i18n-public-types && tsd --files \"**/*.test-d.ts\" && cd ../internal-src-types && tsd --files \"**/*.test-d.ts\" && cd ../resolvers-public-types && tsd --files \"**/*.test-d.ts\" && cd ../runtime-public-types && tsd --files \"**/*.test-d.ts\" && cd ../test-artifact-public-types && tsd --files \"**/*.test-d.ts\"",
|
|
193
205
|
"lint:src": "eslint src --ext .ts",
|
|
194
206
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
195
207
|
"sync": "cnpm sync weapp-vite"
|
package/dist/file-BRQqRekU.mjs
DELETED