weapp-vite 6.11.1 → 6.11.4
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 +2 -2
- package/dist/cli.mjs +6 -20
- package/dist/{config-mYISi4CS.d.mts → config-DFy0eHs2.d.mts} +12 -0
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-B55TlVaK.mjs → createContext-D2PataOA.mjs} +2834 -2405
- package/dist/{file-UVjSUNS_.mjs → file-hsZ3VxaT.mjs} +1 -1
- package/dist/index.d.mts +6 -4
- package/dist/index.mjs +2 -2
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +6 -7
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getCompilerContext } from "./createContext-
|
|
1
|
+
import { i as getCompilerContext } from "./createContext-D2PataOA.mjs";
|
|
2
2
|
import "./logger-gutcwWKE.mjs";
|
|
3
|
-
import "./file-
|
|
3
|
+
import "./file-hsZ3VxaT.mjs";
|
|
4
4
|
//#region src/auto-routes.ts
|
|
5
5
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
6
6
|
function createGetter(resolver) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as normalizeMiniPlatform, d as SHARED_CHUNK_VIRTUAL_PREFIX, f as resolveWeappConfigFile, g as isPathInside, h as createCjsConfigLoadError, l as resolveMiniPlatform, m as getProjectConfigFileName, n as syncProjectSupportFiles, o as formatBytes, p as checkRuntime, r as syncManagedTsconfigBootstrapFiles, s as DEFAULT_MP_PLATFORM, t as createCompilerContext, u as createSharedBuildConfig } from "./createContext-D2PataOA.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-gutcwWKE.mjs";
|
|
3
|
-
import { f as VERSION } from "./file-
|
|
3
|
+
import { f as VERSION } from "./file-hsZ3VxaT.mjs";
|
|
4
4
|
import { resolveWeappMcpConfig, startWeappViteMcpServer } from "./mcp.mjs";
|
|
5
5
|
import { defu } from "@weapp-core/shared";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
@@ -1107,27 +1107,13 @@ function registerPrepareCommand(cli) {
|
|
|
1107
1107
|
cli.command("prepare [...input]", "generate .weapp-vite support files").action(async (input, options) => {
|
|
1108
1108
|
try {
|
|
1109
1109
|
filterDuplicateOptions(options);
|
|
1110
|
-
|
|
1110
|
+
await syncProjectSupportFiles(await createCompilerContext({
|
|
1111
1111
|
cwd: path.resolve(resolvePrepareRoot(input)),
|
|
1112
1112
|
isDev: false,
|
|
1113
1113
|
mode: typeof options.mode === "string" ? options.mode : "development",
|
|
1114
|
-
configFile: resolveConfigFile(options)
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
if (ctx.autoRoutesService.isEnabled()) await ctx.autoRoutesService.ensureFresh();
|
|
1118
|
-
const autoImportConfig = getAutoImportConfig(ctx.configService);
|
|
1119
|
-
if (autoImportConfig) {
|
|
1120
|
-
ctx.autoImportService.reset();
|
|
1121
|
-
const globs = autoImportConfig.globs;
|
|
1122
|
-
if (Array.isArray(globs) && globs.length > 0) {
|
|
1123
|
-
const files = await findAutoImportCandidates({
|
|
1124
|
-
ctx,
|
|
1125
|
-
resolvedConfig: { build: { outDir: ctx.configService.outDir } }
|
|
1126
|
-
}, globs);
|
|
1127
|
-
await Promise.all(files.map((file) => ctx.autoImportService.registerPotentialComponent(file)));
|
|
1128
|
-
} else if (!shouldBootstrapAutoImportWithoutGlobs(autoImportConfig)) logger_default.info("未检测到可预生成的 auto import 输出。");
|
|
1129
|
-
await ctx.autoImportService.awaitManifestWrites();
|
|
1130
|
-
}
|
|
1114
|
+
configFile: resolveConfigFile(options),
|
|
1115
|
+
syncSupportFiles: false
|
|
1116
|
+
}));
|
|
1131
1117
|
logger_default.info("已生成 .weapp-vite 支持文件。");
|
|
1132
1118
|
} catch (error) {
|
|
1133
1119
|
logger_default.warn(`[prepare] ${formatPrepareSkipMessage$1(error)}`);
|
|
@@ -500,12 +500,24 @@ interface WeappDebugConfig {
|
|
|
500
500
|
watchFiles?: (watchFiles: string[], subPackageMeta?: SubPackageMetaValue) => void;
|
|
501
501
|
resolveId?: (id: string, subPackageMeta?: SubPackageMetaValue) => void;
|
|
502
502
|
load?: (id: string, subPackageMeta?: SubPackageMetaValue) => void;
|
|
503
|
+
vueTransformTiming?: (timing: {
|
|
504
|
+
id: string;
|
|
505
|
+
isPage: boolean;
|
|
506
|
+
totalMs: number;
|
|
507
|
+
stages: Record<string, number>;
|
|
508
|
+
}) => void;
|
|
503
509
|
inspect?: WrapPluginOptions;
|
|
504
510
|
}
|
|
505
511
|
/**
|
|
506
512
|
* @description weapp-vite 主配置
|
|
507
513
|
*/
|
|
508
514
|
interface WeappViteConfig {
|
|
515
|
+
/**
|
|
516
|
+
* 开发态是否在启动构建前清空输出目录。
|
|
517
|
+
* 开发态默认 `true`,设置为 `false` 可跳过每次 dev 启动前的全量输出目录清理。
|
|
518
|
+
* 生产构建始终会清空输出目录。
|
|
519
|
+
*/
|
|
520
|
+
cleanOutputsInDev?: boolean;
|
|
509
521
|
/**
|
|
510
522
|
* 应用入口目录(`app.json` 所在目录)。
|
|
511
523
|
*/
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Cn as WeappViteHostMeta, Dn as isWeappViteHost, En as createWeappViteHostMeta, On as resolveWeappViteHostMeta, Sn as WEAPP_VITE_HOST_NAME, Tn as applyWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, et as WeappViteConfig, 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, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, wn as WeappViteRuntime, y as defineThemeJson } from "./config-
|
|
1
|
+
import { Cn as WeappViteHostMeta, Dn as isWeappViteHost, En as createWeappViteHostMeta, On as resolveWeappViteHostMeta, Sn as WEAPP_VITE_HOST_NAME, Tn as applyWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, et as WeappViteConfig, 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, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, wn as WeappViteRuntime, y as defineThemeJson } from "./config-DFy0eHs2.mjs";
|
|
2
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 };
|