weapp-vite 6.19.4 → 6.20.0
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 +10 -3
- package/dist/{config-DWY8nWj0.d.mts → config-ClSNHsDH.d.mts} +12 -2
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-r2rcHex1.mjs → createContext-CtCNbqdC.mjs} +651 -86
- package/dist/file-CQTcjEWz.mjs +2 -0
- package/dist/{file-C-T36DmG.mjs → file-NyBgGJm2.mjs} +10 -4
- package/dist/getInstance-DkRC6-mO.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 +2 -2
- package/package.json +13 -10
- package/dist/file-CV6ZWiTX.mjs +0 -2
- package/dist/getInstance-HvLRUAtA.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as getCompilerContext, v as getRouteRuntimeGlobalKeys } from "./createContext-
|
|
1
|
+
import { n as getCompilerContext, v as getRouteRuntimeGlobalKeys } from "./createContext-CtCNbqdC.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 parseCommentJson, D as isPathInside, E as shouldPassPlatformArgToIdeOpen, S as loadViteConfigFile, T as getDefaultIdeProjectRoot, _ as resolveHmrProfileJsonPath, a as formatBytes, b as checkRuntime, d as getBackendForCapability, f as resolveBackendExecution, g as SHARED_CHUNK_VIRTUAL_PREFIX, h as createSharedBuildConfig, m as syncManagedTsconfigBootstrapFiles, p as syncProjectSupportFiles, t as createCompilerContext, w as createCjsConfigLoadError, x as getProjectConfigFileName, y as resolveWeappConfigFile } from "./createContext-
|
|
1
|
+
import { C as parseCommentJson, D as isPathInside, E as shouldPassPlatformArgToIdeOpen, S as loadViteConfigFile, T as getDefaultIdeProjectRoot, _ as resolveHmrProfileJsonPath, a as formatBytes, b as checkRuntime, d as getBackendForCapability, f as resolveBackendExecution, g as SHARED_CHUNK_VIRTUAL_PREFIX, h as createSharedBuildConfig, m as syncManagedTsconfigBootstrapFiles, p as syncProjectSupportFiles, t as createCompilerContext, w as createCjsConfigLoadError, x as getProjectConfigFileName, y as resolveWeappConfigFile } from "./createContext-CtCNbqdC.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
3
|
+
import { h as VERSION } from "./file-NyBgGJm2.mjs";
|
|
4
4
|
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-BG6TliEg.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -2816,6 +2816,11 @@ function logBuildPackageSizeReport(options) {
|
|
|
2816
2816
|
}
|
|
2817
2817
|
}
|
|
2818
2818
|
//#endregion
|
|
2819
|
+
//#region src/cli/nodeEnv.ts
|
|
2820
|
+
function setCommandNodeEnv(nodeEnv) {
|
|
2821
|
+
process.env.NODE_ENV = nodeEnv;
|
|
2822
|
+
}
|
|
2823
|
+
//#endregion
|
|
2819
2824
|
//#region src/cli/commands/build.ts
|
|
2820
2825
|
function isSassEmbeddedChild(handle) {
|
|
2821
2826
|
return Boolean(handle && typeof handle === "object" && "kill" in handle && "spawnfile" in handle && typeof handle.spawnfile === "string" && handle.spawnfile?.includes("sass-embedded"));
|
|
@@ -2869,6 +2874,7 @@ function registerBuildCommand(cli) {
|
|
|
2869
2874
|
let buildCompleted = false;
|
|
2870
2875
|
try {
|
|
2871
2876
|
filterDuplicateOptions(options);
|
|
2877
|
+
setCommandNodeEnv("production");
|
|
2872
2878
|
const cwd = root ?? process.cwd();
|
|
2873
2879
|
const configFile = resolveConfigFile(options);
|
|
2874
2880
|
targets = resolveRuntimeTargets(options);
|
|
@@ -4540,7 +4546,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
4540
4546
|
}
|
|
4541
4547
|
//#endregion
|
|
4542
4548
|
//#region package.json
|
|
4543
|
-
var version = "6.
|
|
4549
|
+
var version = "6.20.0";
|
|
4544
4550
|
//#endregion
|
|
4545
4551
|
//#region src/cli/devHotkeys/format.ts
|
|
4546
4552
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -5206,6 +5212,7 @@ function writePostOpenSeparator() {
|
|
|
5206
5212
|
function registerServeCommand(cli) {
|
|
5207
5213
|
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--login-retry <mode>", "[string] login retry mode for Wechat DevTools (never | once | always)").option("--login-retry-timeout <ms>", "[number] login retry prompt timeout in milliseconds").option("--non-interactive", "[boolean] fail immediately when Wechat DevTools login has expired").option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").option("--mcp", "[boolean] auto start MCP service during dev").option("--no-mcp", "[boolean] disable MCP service during dev").option("--host [host]", `[string] web dev server host`).option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 启动分包分析仪表盘 (实验特性)`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
5208
5214
|
filterDuplicateOptions(options);
|
|
5215
|
+
setCommandNodeEnv("development");
|
|
5209
5216
|
const cwd = root ?? process.cwd();
|
|
5210
5217
|
const configFile = resolveConfigFile(options);
|
|
5211
5218
|
const targets = resolveRuntimeTargets(options);
|
|
@@ -646,6 +646,15 @@ interface WeappWevuConfig {
|
|
|
646
646
|
*/
|
|
647
647
|
runtime?: 'auto' | 'dev' | 'build';
|
|
648
648
|
}
|
|
649
|
+
interface WeappReactCompilerConfig {
|
|
650
|
+
compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all';
|
|
651
|
+
engine?: 'swc';
|
|
652
|
+
}
|
|
653
|
+
interface WeappReactConfig {
|
|
654
|
+
compiler?: boolean | WeappReactCompilerConfig;
|
|
655
|
+
renderMode?: 'auto' | 'dynamic' | 'static';
|
|
656
|
+
devWarnings?: boolean;
|
|
657
|
+
}
|
|
649
658
|
interface WeappRouteRule {
|
|
650
659
|
appLayout?: PageLayoutMeta;
|
|
651
660
|
}
|
|
@@ -829,6 +838,7 @@ interface WeappViteConfig {
|
|
|
829
838
|
worker?: WeappWorkerConfig;
|
|
830
839
|
vue?: WeappVueConfig;
|
|
831
840
|
wevu?: WeappWevuConfig;
|
|
841
|
+
react?: boolean | WeappReactConfig;
|
|
832
842
|
routeRules?: WeappRouteRules;
|
|
833
843
|
appPrelude?: boolean | WeappAppPreludeConfig;
|
|
834
844
|
injectWeapi?: boolean | WeappInjectWeapiConfig;
|
|
@@ -928,7 +938,7 @@ interface BindingErrorLike {
|
|
|
928
938
|
}
|
|
929
939
|
//#endregion
|
|
930
940
|
//#region src/moduleGraph/protocol.d.ts
|
|
931
|
-
type SidecarModuleKind = 'json' | 'layout' | 'script' | 'style' | 'template' | 'using-component' | 'wxs';
|
|
941
|
+
type SidecarModuleKind = 'json' | 'jsx' | 'layout' | 'script' | 'style' | 'template' | 'using-component' | 'wxs';
|
|
932
942
|
//#endregion
|
|
933
943
|
//#region src/moduleGraph/types.d.ts
|
|
934
944
|
interface BuildModuleInfo {
|
|
@@ -2021,4 +2031,4 @@ declare module 'vite' {
|
|
|
2021
2031
|
*/
|
|
2022
2032
|
declare function defineConfig<T extends UserConfigExport>(config: T): T;
|
|
2023
2033
|
//#endregion
|
|
2024
|
-
export { WeappAnalyzeBudgetConfig as $,
|
|
2034
|
+
export { WeappAnalyzeBudgetConfig as $, WeappViteRuntime as $n, GenerateTemplate as $t, Ref as A, WeappLibComponentJson as An, WeappRequestRuntimeConfig as At, BindingErrorLike as B, WeappManagedSharedTsconfigConfig as Bn, Alias as Bt, LoadConfigOptions as C, SharedChunkOverride as Cn, WeappInjectWeapiConfig as Ct, MethodDefinitions$1 as D, SubPackageStyleConfigObject as Dn, WeappNpmConfig as Dt, InlineConfig$1 as E, SubPackageStyleConfigEntry as En, WeappMcpConfig as Et, RolldownPlugin as F, WeappLibInternalDtsOptions as Fn, WeappVueConfig as Ft, EntryJsonFragment as G, applyWeappViteHostMeta as Gn, CopyGlobs as Gt, BaseEntry as H, WeappWebConfig as Hn, AlipayNpmMode as Ht, RolldownPluginOption as I, WeappLibVueTscOptions as In, WeappVueTemplateConfig as It, ScanComponentItem as J, resolveWeappViteHostMeta as Jn, GenerateDirsOptions as Jt, PageEntry as K, createWeappViteHostMeta as Kn, CopyOptions as Kt, RolldownWatchOptions as L, WeappManagedAppTsconfigConfig as Ln, WeappWebRuntimeConfig as Lt, RolldownBuild as M, WeappLibDtsOptions as Mn, WeappRouteRules as Mt, RolldownOptions as N, WeappLibEntryContext as Nn, WeappSubPackageConfig as Nt, Plugin$1 as O, SubPackageStyleEntry as On, WeappReactCompilerConfig as Ot, RolldownOutput$1 as P, WeappLibFileName as Pn, WeappUniAppConfig as Pt, UserConfig$2 as Q, WeappVitePlatform as Qn, GenerateOptions as Qt, RolldownWatcher$1 as R, WeappManagedNodeTsconfigConfig as Rn, WeappWevuConfig as Rt, CompilerContext as S, SharedChunkMode as Sn, WeappInjectRequestGlobalsTarget as St, ConfigEnv$1 as T, SubPackage as Tn, WeappInjectWebRuntimeGlobalsTarget as Tt, ComponentEntry as U, WEAPP_VITE_HOST_NAME as Un, BuildNpmPackageMeta as Ut, AppEntry as V, WeappManagedTypeScriptConfig as Vn, AliasOptions as Vt, Entry as W, WeappViteHostMeta as Wn, ChunksConfig as Wt, ProjectConfig as X, ResolvedWeappViteTarget as Xn, GenerateFileType as Xt, WxmlDep as Y, ResolveWeappViteTargetOptions as Yn, GenerateExtensionsOptions as Yt, SubPackageMetaValue as Z, WEB_PLATFORM_ALIASES as Zn, GenerateFilenamesOptions as Zt, definePageJson as _, NpmPluginPackageConfig as _n, WeappAutoRoutesIncludePattern as _t, UserConfigFnNoEnvPlain as a, GenerateTemplateScope as an, getSupportedWeappViteTargetDescriptors as ar, WeappViteConfig as at, ChangeEvent as b, ResolvedAlias as bn, WeappHmrConfig as bt, UserConfigFnPromise as c, JsonConfig as cn, EnhanceOptions as ct, Component$1 as d, JsonMergeStage as dn, MultiPlatformConfig as dt, GenerateTemplateContext as en, WeappViteTargetDescriptor as er, WeappAnalyzeConfig as et, Page$1 as f, JsonMergeStrategy as fn, ScanWxmlOptions as ft, defineComponentJson as g, NpmMainPackageConfig as gn, WeappAutoRoutesInclude as gt, defineAppJson as h, NpmDependencyPattern as hn, WeappAutoRoutesConfig as ht, UserConfigFnNoEnv as i, GenerateTemplateInlineSource as in, getSupportedWeappVitePlatforms as ir, WeappForwardConsoleLogLevel as it, ResolvedConfig as j, WeappLibConfig as jn, WeappRouteRule as jt, PluginOption as k, SubPackageStyleScope as kn, WeappReactConfig as kt, defineConfig as l, JsonMergeContext as ln, EnhanceWxmlOptions as lt, Theme$1 as m, NpmBuildOptions as mn, WeappAppPreludeMode as mt, UserConfigExport as n, GenerateTemplateFactory as nn, WeappViteTargetKind as nr, WeappDebugConfig as nt, UserConfigFnObject as o, GenerateTemplatesConfig as on, isWebPlatform as or, AutoImportComponents as ot, Sitemap$1 as p, MpPlatform$1 as pn, WeappAppPreludeConfig as pt, ComponentsMap as q, isWeappViteHost as qn, DeprecatedInlineDynamicImports as qt, UserConfigFn as r, GenerateTemplateFileSource as rn, WebPlatform as rr, WeappForwardConsoleConfig as rt, UserConfigFnObjectPlain as s, JsFormat as sn, resolveWeappViteTarget as sr, AutoImportComponentsOption as st, UserConfig$1 as t, GenerateTemplateEntry as tn, WeappViteTargetInput as tr, WeappAnalyzeHistoryConfig as tt, App$1 as u, JsonMergeFunction as un, HandleWxmlOptions as ut, defineSitemapJson as v, NpmStrategy as vn, WeappBuildScopeConfig as vt, ComputedDefinitions$1 as w, SharedChunkStrategy as wn, WeappInjectWebRuntimeGlobalsConfig as wt, WeappVitePluginApi as x, SharedChunkDynamicImports as xn, WeappInjectRequestGlobalsConfig as xt, defineThemeJson as y, NpmSubPackageConfig as yn, WeappBuildScopeObjectConfig as yt, ViteDevServer$1 as z, WeappManagedServerTsconfigConfig as zn, WeappWorkerConfig as zt };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as WeappViteRuntime, Gn as applyWeappViteHostMeta, Jn as resolveWeappViteHostMeta, Kn as createWeappViteHostMeta, Un as WEAPP_VITE_HOST_NAME, Wn as WeappViteHostMeta, _ 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 isWeappViteHost, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-ClSNHsDH.mjs";
|
|
2
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 };
|