weapp-vite 6.24.0 → 6.25.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/README.md +1 -0
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +4 -4
- package/dist/{config-qh0O73A5.d.mts → config-Fg6rCCMb.d.mts} +13 -4
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-DddiW1j3.mjs → createContext-DVzd-0tU.mjs} +1025 -605
- package/dist/docs/README.md +1 -0
- package/dist/docs/weapp-config.md +31 -0
- package/dist/file-XlRiJP3-.mjs +2 -0
- package/dist/{file-CaKJV6Km.mjs → file-zQ4br3El.mjs} +79 -79
- package/dist/getInstance-DZ87aPw-.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 +10 -9
- package/dist/file-QyWJOwaH.mjs +0 -2
- package/dist/getInstance-BXs7VCNS.mjs +0 -2
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
- ♻️ **实验性状态保持 HMR**:微信开发者工具中可保留 Page/Component/wevu 状态并替换 JavaScript 方法
|
|
30
30
|
- 🔌 **插件生态**:Vite 插件生态支持,也可以自定义编写插件,方便扩展
|
|
31
31
|
- 🌐 **实验性 Web Runtime**:同一份原生 WXML/WXSS/TS 或 wevu Vue SFC 源码可通过 `-p web` 启动和构建浏览器版本
|
|
32
|
+
- 🎨 **内置 Tailwind CSS**:通过 `weapp.tailwindcss` 配置 `weapp-tailwindcss` 的 core 与 generator 集成;Tailwind CSS v4 项目引入 `tailwindcss` 后可自动启用
|
|
32
33
|
- 🧩 **实验性 uni-app 组件库兼容**:通过显式依赖白名单与 `WotUiResolver()` 在微信小程序和 Web 中使用 Wot UI Vue SFC
|
|
33
34
|
- 🧰 **IDE 命令增强**:可直接透传 `weapp-ide-cli` 全量命令(`preview/upload/config/automator` 等)
|
|
34
35
|
- 🧪 **真实产物单测**:`weapp-vite/test` 提供不启动 CLI 的程序化测试构建入口,可配合 `@mpcore/test` 测试页面和组件
|
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-DVzd-0tU.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 { A as getDefaultIdeProjectRoot, C as collectPreloadPages, D as loadViteConfigFile, E as suggestPreloadRules, M as isPathInside, O as
|
|
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-DVzd-0tU.mjs";
|
|
2
|
+
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-zQ4br3El.mjs";
|
|
2
3
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
3
|
-
import { h as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-CaKJV6Km.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";
|
|
@@ -8,8 +8,8 @@ import path, { posix } from "pathe";
|
|
|
8
8
|
import path$1 from "node:path";
|
|
9
9
|
import { defu } from "@weapp-core/shared";
|
|
10
10
|
import { fs as fs$1 } from "@weapp-core/shared/fs";
|
|
11
|
-
import { parse } from "vue/compiler-sfc";
|
|
12
11
|
import process from "node:process";
|
|
12
|
+
import { parse } from "vue/compiler-sfc";
|
|
13
13
|
import fs$2, { mkdir, writeFile } from "node:fs/promises";
|
|
14
14
|
import { build, createServer } from "vite";
|
|
15
15
|
import os from "node:os";
|
|
@@ -5044,7 +5044,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
5044
5044
|
}
|
|
5045
5045
|
//#endregion
|
|
5046
5046
|
//#region package.json
|
|
5047
|
-
var version = "6.
|
|
5047
|
+
var version = "6.25.0";
|
|
5048
5048
|
//#endregion
|
|
5049
5049
|
//#region src/cli/devHotkeys/format.ts
|
|
5050
5050
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -7,6 +7,7 @@ import "@weapp-vite/ast/operations/onPageScroll";
|
|
|
7
7
|
import "@weapp-vite/ast/operations/setDataPick";
|
|
8
8
|
import { LoggerConfig } from "@weapp-core/logger";
|
|
9
9
|
import "@weapp-vite/ast/babel";
|
|
10
|
+
import { VueSfcBlockSignatures } from "wevu/compiler";
|
|
10
11
|
import { ConfigEnv, ConfigEnv as ConfigEnv$1, InlineConfig, InlineConfig as InlineConfig$1, Plugin as Plugin$1, PluginOption, ResolvedConfig, UserConfig, ViteDevServer, ViteDevServer as ViteDevServer$1, build } from "vite";
|
|
11
12
|
import { LRUCache } from "lru-cache";
|
|
12
13
|
import { fdir } from "fdir";
|
|
@@ -21,6 +22,8 @@ import { MiniProgramNetworkDefaults } from "@wevu/web-apis";
|
|
|
21
22
|
import { App, App as App$1, Component, Component as Component$1, GenerateType, Page, Page as Page$1, Plugin, Sitemap, Sitemap as Sitemap$1, Theme, Theme as Theme$1 } from "@weapp-core/schematics";
|
|
22
23
|
import { WeappWebPluginOptions } from "@weapp-vite/web/plugin";
|
|
23
24
|
import { CompilerOptions } from "typescript";
|
|
25
|
+
import { CreateCompilerOptions } from "weapp-tailwindcss/core";
|
|
26
|
+
import { UserDefinedOptions } from "weapp-tailwindcss/types";
|
|
24
27
|
import { DetectResult } from "package-manager-detector";
|
|
25
28
|
//#region src/runtimeTarget.d.ts
|
|
26
29
|
type WebPlatform = 'web';
|
|
@@ -691,6 +694,7 @@ interface WeappRouteRule {
|
|
|
691
694
|
type WeappRouteRules = Record<string, WeappRouteRule>;
|
|
692
695
|
//#endregion
|
|
693
696
|
//#region src/types/config/main.d.ts
|
|
697
|
+
type WeappTailwindcssOptions = UserDefinedOptions & Pick<CreateCompilerOptions, 'compiler'>;
|
|
694
698
|
/**
|
|
695
699
|
* @description 分包元信息
|
|
696
700
|
*/
|
|
@@ -802,6 +806,12 @@ interface WeappViteConfig {
|
|
|
802
806
|
* 生产构建始终会清空输出目录。
|
|
803
807
|
*/
|
|
804
808
|
cleanOutputsInDev?: boolean;
|
|
809
|
+
/**
|
|
810
|
+
* 内置 weapp-tailwindcss 集成。显式配置优先;未配置时,Tailwind CSS v4 且实际引入 `@import "tailwindcss"` 会自动启用。
|
|
811
|
+
* - `true`: 使用默认配置和 `srcRoot/app.css` 入口
|
|
812
|
+
* - `object`: 启用并传入 weapp-tailwindcss core options
|
|
813
|
+
*/
|
|
814
|
+
tailwindcss?: boolean | WeappTailwindcssOptions;
|
|
805
815
|
/**
|
|
806
816
|
* 应用入口目录(`app.json` 所在目录)。
|
|
807
817
|
*/
|
|
@@ -1690,6 +1700,7 @@ interface RuntimeState {
|
|
|
1690
1700
|
};
|
|
1691
1701
|
autoImport: {
|
|
1692
1702
|
registry: Map<string, LocalAutoImportMatch>;
|
|
1703
|
+
normalizedLocalComponents: Map<string, LocalAutoImportMatch>;
|
|
1693
1704
|
resolvedResolverComponents: Map<string, string>;
|
|
1694
1705
|
matcher?: (input: string) => boolean;
|
|
1695
1706
|
matcherKey: string;
|
|
@@ -1717,9 +1728,7 @@ interface RuntimeState {
|
|
|
1717
1728
|
externalComponentEntryMap: Map<string, string>;
|
|
1718
1729
|
entriesMap: Map<string, Entry | undefined>;
|
|
1719
1730
|
vueEntryHasTemplate: Map<string, boolean>;
|
|
1720
|
-
|
|
1721
|
-
vueEntryScriptSignatures: Map<string, string>;
|
|
1722
|
-
vueEntryStyleIndependentSignatures: Map<string, string>;
|
|
1731
|
+
vueEntrySfcSignatures: Map<string, VueSfcBlockSignatures>;
|
|
1723
1732
|
vueEntryTailwindContentSignatures: Map<string, string>;
|
|
1724
1733
|
vueEntryTailwindTemplateContentSignatures: Map<string, string>;
|
|
1725
1734
|
vueEntryTailwindScriptContentSignatures: Map<string, string>;
|
|
@@ -2105,4 +2114,4 @@ declare module 'vite' {
|
|
|
2105
2114
|
*/
|
|
2106
2115
|
declare function defineConfig<T extends UserConfigExport>(config: T): T;
|
|
2107
2116
|
//#endregion
|
|
2108
|
-
export { WeappAnalyzeBudgetConfig as $,
|
|
2117
|
+
export { WeappAnalyzeBudgetConfig as $, applyWeappViteHostMeta as $n, GenerateFileType as $t, Ref as A, StyleConfigObject as An, WeappPreloadRule as At, BindingErrorLike as B, WeappLibDtsOptions as Bn, WeappWebRuntimeConfig as Bt, LoadConfigOptions as C, NpmSubPackageConfig as Cn, WeappInjectRequestGlobalsTarget as Ct, MethodDefinitions$1 as D, SharedChunkOverride as Dn, WeappMcpConfig as Dt, InlineConfig$1 as E, SharedChunkMode as En, WeappInjectWebRuntimeGlobalsTarget as Et, RolldownPlugin as F, SubPackageStyleConfigObject as Fn, WeappRouteRules as Ft, EntryJsonFragment as G, WeappManagedAppTsconfigConfig as Gn, AlipayNpmMode as Gt, BaseEntry as H, WeappLibFileName as Hn, WeappWorkerConfig as Ht, RolldownPluginOption as I, SubPackageStyleEntry as In, WeappSubPackageConfig as It, ScanComponentItem as J, WeappManagedSharedTsconfigConfig as Jn, CopyGlobs as Jt, PageEntry as K, WeappManagedNodeTsconfigConfig as Kn, BuildNpmPackageMeta as Kt, RolldownWatchOptions as L, SubPackageStyleScope as Ln, WeappUniAppConfig as Lt, RolldownBuild as M, StyleScope as Mn, WeappReactConfig as Mt, RolldownOptions as N, SubPackage as Nn, WeappRequestRuntimeConfig as Nt, Plugin$1 as O, SharedChunkStrategy as On, WeappNpmConfig as Ot, RolldownOutput$1 as P, SubPackageStyleConfigEntry as Pn, WeappRouteRule as Pt, UserConfig$2 as Q, WeappViteHostMeta as Qn, GenerateExtensionsOptions as Qt, RolldownWatcher$1 as R, WeappLibComponentJson as Rn, WeappVueConfig as Rt, CompilerContext as S, NpmStrategy as Sn, WeappInjectRequestGlobalsConfig as St, ConfigEnv$1 as T, SharedChunkDynamicImports as Tn, WeappInjectWebRuntimeGlobalsConfig as Tt, ComponentEntry as U, WeappLibInternalDtsOptions as Un, Alias as Ut, AppEntry as V, WeappLibEntryContext as Vn, WeappWevuConfig as Vt, Entry as W, WeappLibVueTscOptions as Wn, AliasOptions as Wt, ProjectConfig as X, WeappWebConfig as Xn, DeprecatedInlineDynamicImports as Xt, WxmlDep as Y, WeappManagedTypeScriptConfig as Yn, CopyOptions as Yt, SubPackageMetaValue as Z, WEAPP_VITE_HOST_NAME as Zn, GenerateDirsOptions as Zt, definePageJson as _, NpmBuildOptions as _n, WeappAutoRoutesInclude as _t, UserConfigFnNoEnvPlain as a, GenerateTemplateFactory as an, WEB_PLATFORM_ALIASES as ar, WeappTailwindcssOptions as at, ChangeEvent as b, NpmPackageFilesConfig as bn, WeappBuildScopeObjectConfig as bt, UserConfigFnPromise as c, GenerateTemplateScope as cn, WeappViteTargetDescriptor as cr, AutoImportComponentsOption as ct, Component$1 as d, JsonConfig as dn, WebPlatform as dr, HandleWxmlOptions as dt, GenerateFilenamesOptions as en, createWeappViteHostMeta as er, WeappAnalyzeConfig as et, Page$1 as f, JsonMergeContext as fn, getSupportedWeappVitePlatforms as fr, MultiPlatformConfig as ft, defineComponentJson as g, MpPlatform$1 as gn, WeappAutoRoutesConfig as gt, defineAppJson as h, JsonMergeStrategy as hn, resolveWeappViteTarget as hr, WeappAppPreludeMode as ht, UserConfigFnNoEnv as i, GenerateTemplateEntry as in, ResolvedWeappViteTarget as ir, WeappForwardConsoleLogLevel as it, ResolvedConfig as j, StyleEntry as jn, WeappReactCompilerConfig as jt, PluginOption as k, StyleConfigEntry as kn, WeappPreloadNetwork as kt, defineConfig as l, GenerateTemplatesConfig as ln, WeappViteTargetInput as lr, EnhanceOptions as lt, Theme$1 as m, JsonMergeStage as mn, isWebPlatform as mr, WeappAppPreludeConfig as mt, UserConfigExport as n, GenerateTemplate as nn, resolveWeappViteHostMeta as nr, WeappDebugConfig as nt, UserConfigFnObject as o, GenerateTemplateFileSource as on, WeappVitePlatform as or, WeappViteConfig as ot, Sitemap$1 as p, JsonMergeFunction as pn, getSupportedWeappViteTargetDescriptors as pr, ScanWxmlOptions as pt, ComponentsMap as q, WeappManagedServerTsconfigConfig as qn, ChunksConfig as qt, UserConfigFn as r, GenerateTemplateContext as rn, ResolveWeappViteTargetOptions as rr, WeappForwardConsoleConfig as rt, UserConfigFnObjectPlain as s, GenerateTemplateInlineSource as sn, WeappViteRuntime as sr, AutoImportComponents as st, UserConfig$1 as t, GenerateOptions as tn, isWeappViteHost as tr, WeappAnalyzeHistoryConfig as tt, App$1 as u, JsFormat as un, WeappViteTargetKind as ur, EnhanceWxmlOptions as ut, defineSitemapJson as v, NpmDependencyPattern as vn, WeappAutoRoutesIncludePattern as vt, ComputedDefinitions$1 as w, ResolvedAlias as wn, WeappInjectWeapiConfig as wt, WeappVitePluginApi as x, NpmPluginPackageConfig as xn, WeappHmrConfig as xt, defineThemeJson as y, NpmMainPackageConfig as yn, WeappBuildScopeConfig as yt, ViteDevServer$1 as z, WeappLibConfig as zn, WeappVueTemplateConfig as zt };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $n as
|
|
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-Fg6rCCMb.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 };
|