weapp-vite 6.25.1 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/{createContext-BDkOoFQ4.mjs → createContext-CwKw7Ban.mjs} +46 -4
- package/dist/{file-DhJ5CIQD.mjs → file-C0rR_V0f.mjs} +1 -1
- package/dist/file-uhBc0Ffs.mjs +2 -0
- package/dist/getInstance-CczmNJ2e.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/test.mjs +1 -1
- package/package.json +22 -22
- package/dist/file-noVM_1J1.mjs +0 -2
- package/dist/getInstance-CrwYvGAT.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-CwKw7Ban.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-CwKw7Ban.mjs";
|
|
2
|
+
import { f as VERSION, i as findJsEntry, o as findTemplateEntry, s as findVueEntry } from "./file-C0rR_V0f.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";
|
|
@@ -5044,7 +5044,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
5044
5044
|
}
|
|
5045
5045
|
//#endregion
|
|
5046
5046
|
//#region package.json
|
|
5047
|
-
var version = "
|
|
5047
|
+
var version = "7.0.1";
|
|
5048
5048
|
//#endregion
|
|
5049
5049
|
//#region src/cli/devHotkeys/format.ts
|
|
5050
5050
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost--CaeyWpA.mjs";
|
|
2
|
-
import { C as inlineAutoRoutesImports, T 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, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-
|
|
2
|
+
import { C as inlineAutoRoutesImports, T 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, x as isSourceStyleExtension, y as ALL_NATIVE_STYLE_RESOLVER_EXTENSIONS } from "./file-C0rR_V0f.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";
|
|
@@ -30367,6 +30367,8 @@ function createCoreLifecyclePlugin(state) {
|
|
|
30367
30367
|
//#region src/plugins/core/requireAnalysis.ts
|
|
30368
30368
|
const REQUIRE_ANALYSIS_FILTER_RE = /\.[jt]s$/;
|
|
30369
30369
|
const URL_SUFFIX_RE = /[?#].*$/;
|
|
30370
|
+
const REQUIRE_ASYNC_TARGET_MARKER_PREFIX = "__weapp_vite_require_async_target__";
|
|
30371
|
+
const REQUIRE_ASYNC_TARGET_MARKER_RE = new RegExp(`\\brequire\\.async\\(\\s*(['"])${REQUIRE_ASYNC_TARGET_MARKER_PREFIX}([\\w-]+)\\1\\s*\\)`, "g");
|
|
30370
30372
|
function cleanModuleId(id) {
|
|
30371
30373
|
return id.replace(URL_SUFFIX_RE, "");
|
|
30372
30374
|
}
|
|
@@ -30374,6 +30376,38 @@ function createRelativeModuleSpecifier(importerFileName, targetFileName) {
|
|
|
30374
30376
|
const relativePath = path.relative(path.dirname(importerFileName), targetFileName);
|
|
30375
30377
|
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
30376
30378
|
}
|
|
30379
|
+
function createRequireAsyncTargetMarker(fileName) {
|
|
30380
|
+
return `${REQUIRE_ASYNC_TARGET_MARKER_PREFIX}${Buffer.from(fileName).toString("base64url")}`;
|
|
30381
|
+
}
|
|
30382
|
+
function decodeRequireAsyncTargetMarker(value) {
|
|
30383
|
+
if (!value.startsWith(REQUIRE_ASYNC_TARGET_MARKER_PREFIX)) return null;
|
|
30384
|
+
try {
|
|
30385
|
+
return Buffer.from(value.slice(35), "base64url").toString("utf8");
|
|
30386
|
+
} catch {
|
|
30387
|
+
return null;
|
|
30388
|
+
}
|
|
30389
|
+
}
|
|
30390
|
+
/**
|
|
30391
|
+
* 按最终 chunk 文件名修正异步分包加载路径。
|
|
30392
|
+
*/
|
|
30393
|
+
function rewriteRequireAsyncChunkPaths(code, importerFileName) {
|
|
30394
|
+
const source = new MagicString(code);
|
|
30395
|
+
let changed = false;
|
|
30396
|
+
for (const match of code.matchAll(REQUIRE_ASYNC_TARGET_MARKER_RE)) {
|
|
30397
|
+
if (typeof match.index !== "number") continue;
|
|
30398
|
+
const targetFileName = decodeRequireAsyncTargetMarker(`${REQUIRE_ASYNC_TARGET_MARKER_PREFIX}${match[2]}`);
|
|
30399
|
+
if (!targetFileName) continue;
|
|
30400
|
+
const literalStart = match.index + match[0].indexOf(match[1]);
|
|
30401
|
+
const literalEnd = literalStart + 35 + match[2].length + 2;
|
|
30402
|
+
source.overwrite(literalStart, literalEnd, JSON.stringify(createRelativeModuleSpecifier(importerFileName, targetFileName)));
|
|
30403
|
+
changed = true;
|
|
30404
|
+
}
|
|
30405
|
+
if (!changed) return null;
|
|
30406
|
+
return {
|
|
30407
|
+
code: source.toString(),
|
|
30408
|
+
map: source.generateMap({ hires: "boundary" })
|
|
30409
|
+
};
|
|
30410
|
+
}
|
|
30377
30411
|
function resolveModulePackageRoot(id, relativeAbsoluteSrcRoot, subPackageRoots) {
|
|
30378
30412
|
return resolveSubPackagePrefix(relativeAbsoluteSrcRoot(cleanModuleId(id)), subPackageRoots);
|
|
30379
30413
|
}
|
|
@@ -30422,7 +30456,6 @@ function createRequireAnalysisPlugin(state) {
|
|
|
30422
30456
|
const dependencyRewrites = [];
|
|
30423
30457
|
const nativeImportTokens = [];
|
|
30424
30458
|
const resolvedDependencies = [];
|
|
30425
|
-
const importerFileName = resolveRelativeOutputFileNameWithExtension(configService, cleanModuleId(id), ".js");
|
|
30426
30459
|
const subPackageRoots = [...scanService.subPackageMap.keys()].filter(Boolean).sort((left, right) => right.length - left.length);
|
|
30427
30460
|
const importerPackageRoot = resolveModulePackageRoot(id, configService.relativeAbsoluteSrcRoot, subPackageRoots);
|
|
30428
30461
|
const resolveDependency = async (token) => {
|
|
@@ -30437,7 +30470,7 @@ function createRequireAnalysisPlugin(state) {
|
|
|
30437
30470
|
fileName,
|
|
30438
30471
|
id: resolvedId
|
|
30439
30472
|
},
|
|
30440
|
-
specifier:
|
|
30473
|
+
specifier: createRequireAsyncTargetMarker(fileName)
|
|
30441
30474
|
};
|
|
30442
30475
|
};
|
|
30443
30476
|
for (const token of requireTokens) {
|
|
@@ -30486,6 +30519,15 @@ function createRequireAnalysisPlugin(state) {
|
|
|
30486
30519
|
}
|
|
30487
30520
|
}
|
|
30488
30521
|
},
|
|
30522
|
+
generateBundle(_options, bundle) {
|
|
30523
|
+
for (const output of Object.values(bundle)) {
|
|
30524
|
+
if (output?.type !== "chunk") continue;
|
|
30525
|
+
const chunk = output;
|
|
30526
|
+
const rewritten = rewriteRequireAsyncChunkPaths(chunk.code, chunk.fileName);
|
|
30527
|
+
if (!rewritten) continue;
|
|
30528
|
+
applyOutputChunkTransform(chunk, rewritten.code, rewritten.map);
|
|
30529
|
+
}
|
|
30530
|
+
},
|
|
30489
30531
|
async moduleParsed(moduleInfo) {
|
|
30490
30532
|
const dependencies = moduleInfo.meta.requireAsyncDependencies;
|
|
30491
30533
|
if (!Array.isArray(dependencies)) return;
|
|
@@ -35181,7 +35223,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
35181
35223
|
const { path: appEntryPath } = appEntry;
|
|
35182
35224
|
let configFromVue;
|
|
35183
35225
|
if (!appConfigFile && vueAppPath) {
|
|
35184
|
-
const { extractConfigFromVue } = await import("./file-
|
|
35226
|
+
const { extractConfigFromVue } = await import("./file-uhBc0Ffs.mjs");
|
|
35185
35227
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
35186
35228
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
35187
35229
|
}
|
|
@@ -51,7 +51,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
51
51
|
}
|
|
52
52
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
53
53
|
try {
|
|
54
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
54
|
+
const { getCompilerContext } = await import("./getInstance-CczmNJ2e.mjs");
|
|
55
55
|
const compilerContext = getCompilerContext();
|
|
56
56
|
const service = compilerContext.autoRoutesService;
|
|
57
57
|
const reference = service?.getReference?.();
|
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-CwKw7Ban.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/test.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.1",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -120,6 +120,20 @@
|
|
|
120
120
|
"@vercel/detect-agent": "^1.2.5",
|
|
121
121
|
"@volar/typescript": "^2.4.28",
|
|
122
122
|
"@vue/language-core": "^3.3.11",
|
|
123
|
+
"@weapp-core/constants": "0.2.1",
|
|
124
|
+
"@weapp-core/init": "6.0.16",
|
|
125
|
+
"@weapp-core/logger": "3.1.1",
|
|
126
|
+
"@weapp-core/schematics": "6.2.2",
|
|
127
|
+
"@weapp-core/shared": "3.2.0",
|
|
128
|
+
"@weapp-vite/ast": "7.0.1",
|
|
129
|
+
"@weapp-vite/eslint": "0.2.2",
|
|
130
|
+
"@weapp-vite/i18n": "0.2.1",
|
|
131
|
+
"@weapp-vite/mcp": "1.5.1",
|
|
132
|
+
"@weapp-vite/miniprogram-automator": "1.2.16",
|
|
133
|
+
"@weapp-vite/volar": "2.1.6",
|
|
134
|
+
"@weapp-vite/web": "1.4.18",
|
|
135
|
+
"@wevu/api": "0.3.0",
|
|
136
|
+
"@wevu/web-apis": "1.2.39",
|
|
123
137
|
"cac": "^7.0.0",
|
|
124
138
|
"chokidar": "^5.0.0",
|
|
125
139
|
"comment-json": "^5.0.0",
|
|
@@ -136,38 +150,24 @@
|
|
|
136
150
|
"picomatch": "^4.0.7",
|
|
137
151
|
"postcss": "^8.5.26",
|
|
138
152
|
"rolldown": "1.2.6",
|
|
139
|
-
"rolldown-plugin-dts": "0.28.
|
|
153
|
+
"rolldown-plugin-dts": "0.28.4",
|
|
154
|
+
"rolldown-require": "2.0.27",
|
|
140
155
|
"semver": "^7.8.5",
|
|
141
156
|
"typescript": "^6.0.3",
|
|
142
157
|
"vite": "8.2.2",
|
|
158
|
+
"vite-plugin-performance": "2.0.1",
|
|
143
159
|
"vite-tsconfig-paths": "^6.1.1",
|
|
144
160
|
"vue": "^3.5.42",
|
|
145
161
|
"vue-tsc": "^3.3.11",
|
|
146
|
-
"weapp-
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"@weapp-core/init": "6.0.16",
|
|
150
|
-
"@weapp-core/schematics": "6.2.1",
|
|
151
|
-
"@weapp-core/shared": "3.2.0",
|
|
152
|
-
"@weapp-vite/ast": "6.25.1",
|
|
153
|
-
"@weapp-vite/eslint": "0.2.2",
|
|
154
|
-
"@weapp-vite/i18n": "0.2.0",
|
|
155
|
-
"@weapp-vite/mcp": "1.5.0",
|
|
156
|
-
"@weapp-vite/miniprogram-automator": "1.2.16",
|
|
157
|
-
"@weapp-vite/volar": "2.1.5",
|
|
158
|
-
"@weapp-vite/web": "1.4.16",
|
|
159
|
-
"@wevu/web-apis": "1.2.38",
|
|
160
|
-
"rolldown-require": "2.0.27",
|
|
161
|
-
"@wevu/api": "0.3.0",
|
|
162
|
-
"vite-plugin-performance": "2.0.1",
|
|
163
|
-
"weapp-ide-cli": "6.1.0",
|
|
164
|
-
"wevu": "6.25.1"
|
|
162
|
+
"weapp-ide-cli": "6.1.1",
|
|
163
|
+
"weapp-tailwindcss": "^5.4.2",
|
|
164
|
+
"wevu": "7.0.1"
|
|
165
165
|
},
|
|
166
166
|
"optionalDependencies": {
|
|
167
167
|
"@swc/core": "^1.16.1"
|
|
168
168
|
},
|
|
169
169
|
"devDependencies": {
|
|
170
|
-
"oxc-parser": "^0.
|
|
170
|
+
"oxc-parser": "^0.148.0",
|
|
171
171
|
"oxc-walker": "^1.1.1",
|
|
172
172
|
"tailwindcss": "^4.3.3",
|
|
173
173
|
"ts-morph": "^28.0.0"
|
package/dist/file-noVM_1J1.mjs
DELETED