weapp-vite 6.4.4 → 6.4.6

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-NWLNV653.mjs";
3
+ } from "../chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
6
  init_esm_shims();
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-GWPIUN5P.mjs";
4
- import "./chunk-6CV4BK4W.mjs";
5
- import "./chunk-ASLGPJG2.mjs";
6
- import "./chunk-4QBBC6UB.mjs";
3
+ } from "./chunk-LYVEG4WY.mjs";
4
+ import "./chunk-D2X6N3H6.mjs";
5
+ import "./chunk-ZPJCXU6I.mjs";
6
+ import "./chunk-EG5ZSUGT.mjs";
7
7
  import {
8
8
  init_esm_shims
9
- } from "./chunk-NWLNV653.mjs";
9
+ } from "./chunk-4VWZIUSC.mjs";
10
10
 
11
11
  // src/auto-routes.ts
12
12
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-NWLNV653.mjs";
3
+ } from "./chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/plugins/vue/runtime.ts
6
6
  init_esm_shims();
@@ -27,11 +27,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@25.1.0__@swc+core@1.15.11_jiti@2_b3019e7b0ec3475aea745e75acc07536/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.56.0_@types+node@25.1.0__@swc+core@1.15.11_jiti@2_23a98131df0505982a1408e39c07aa1d/node_modules/tsup/assets/esm_shims.js
31
31
  import path from "path";
32
32
  import { fileURLToPath } from "url";
33
33
  var init_esm_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.55.2_@types+node@25.1.0__@swc+core@1.15.11_jiti@2_b3019e7b0ec3475aea745e75acc07536/node_modules/tsup/assets/esm_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.56.0_@types+node@25.1.0__@swc+core@1.15.11_jiti@2_23a98131df0505982a1408e39c07aa1d/node_modules/tsup/assets/esm_shims.js"() {
35
35
  "use strict";
36
36
  }
37
37
  });
@@ -2,7 +2,7 @@ import {
2
2
  __commonJS,
3
3
  __toESM,
4
4
  init_esm_shims
5
- } from "./chunk-NWLNV653.mjs";
5
+ } from "./chunk-4VWZIUSC.mjs";
6
6
 
7
7
  // ../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js
8
8
  var require_src = __commonJS({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-NWLNV653.mjs";
3
+ } from "./chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/json.ts
6
6
  init_esm_shims();
@@ -15,12 +15,12 @@ import {
15
15
  templateExtensions,
16
16
  touch,
17
17
  vueExtensions
18
- } from "./chunk-6CV4BK4W.mjs";
18
+ } from "./chunk-D2X6N3H6.mjs";
19
19
  import {
20
20
  __commonJS,
21
21
  __toESM,
22
22
  init_esm_shims
23
- } from "./chunk-NWLNV653.mjs";
23
+ } from "./chunk-4VWZIUSC.mjs";
24
24
 
25
25
  // ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
26
26
  var require_debug = __commonJS({
@@ -1953,9 +1953,6 @@ function normalizeViteId(id, options) {
1953
1953
  if (stripVueVirtualPrefix && clean.startsWith(VUE_VIRTUAL_MODULE_PREFIX)) {
1954
1954
  clean = clean.slice(VUE_VIRTUAL_MODULE_PREFIX.length);
1955
1955
  }
1956
- if (clean.includes("\\")) {
1957
- clean = clean.replace(BACKSLASH_RE2, "/");
1958
- }
1959
1956
  if (stripQuery) {
1960
1957
  clean = clean.split("?", 1)[0];
1961
1958
  }
@@ -1967,10 +1964,16 @@ function normalizeViteId(id, options) {
1967
1964
  }
1968
1965
  if (stripAtFsPrefix && clean.startsWith("/@fs/")) {
1969
1966
  clean = clean.slice("/@fs".length);
1967
+ if (/^\/[A-Z]:\//i.test(clean)) {
1968
+ clean = clean.slice(1);
1969
+ }
1970
1970
  }
1971
1971
  if (stripLeadingNullByte && clean.startsWith("\0")) {
1972
1972
  clean = clean.slice(1);
1973
1973
  }
1974
+ if (clean.includes("\\")) {
1975
+ clean = clean.replace(BACKSLASH_RE2, "/");
1976
+ }
1974
1977
  return clean;
1975
1978
  }
1976
1979
 
@@ -10226,7 +10229,6 @@ function createSharedBuildConfig(configService, scanService) {
10226
10229
  }
10227
10230
  ]
10228
10231
  },
10229
- inlineDynamicImports: false,
10230
10232
  chunkFileNames: "[name].js"
10231
10233
  }
10232
10234
  }
@@ -28270,7 +28272,7 @@ function resolveImportee2(importee, jsonPath, configService) {
28270
28272
  }
28271
28273
  function hasDependencyPrefix(dependencies, tokens) {
28272
28274
  return Object.keys(dependencies).some((dep) => {
28273
- const depTokens = dep.split("/");
28275
+ const depTokens = dep.replace(/\\/g, "/").split("/");
28274
28276
  for (let i = 0; i < Math.min(tokens.length, depTokens.length); i++) {
28275
28277
  if (tokens[i] !== depTokens[i]) {
28276
28278
  return false;
@@ -28284,14 +28286,15 @@ function createEntryNormalizer(configService) {
28284
28286
  if (/plugin:\/\//.test(entry)) {
28285
28287
  return entry;
28286
28288
  }
28287
- const tokens = entry.split("/");
28289
+ const normalizedEntry = entry.replace(/\\/g, "/");
28290
+ const tokens = normalizedEntry.split("/");
28288
28291
  if (tokens[0] && isObject5(configService.packageJson.dependencies) && hasDependencyPrefix(configService.packageJson.dependencies, tokens)) {
28289
- return `npm:${entry}`;
28292
+ return `npm:${normalizedEntry}`;
28290
28293
  }
28291
28294
  if (tokens[0] === "") {
28292
- return entry.substring(1);
28295
+ return normalizedEntry.substring(1);
28293
28296
  }
28294
- const normalized = resolveImportee2(entry, jsonPath, configService);
28297
+ const normalized = resolveImportee2(normalizedEntry, jsonPath, configService);
28295
28298
  return configService.relativeAbsoluteSrcRoot(normalized);
28296
28299
  };
28297
28300
  }
@@ -30835,6 +30838,62 @@ init_esm_shims();
30835
30838
  import { createRequire as createRequire8 } from "module";
30836
30839
  import process7 from "process";
30837
30840
  import path58 from "pathe";
30841
+
30842
+ // src/plugins/vue/transform/styleRequest.ts
30843
+ init_esm_shims();
30844
+ var WEAPP_VUE_STYLE_VIRTUAL_PREFIX = "\0weapp-vite:vue-style:";
30845
+ function parseWeappVueStyleRequest(id) {
30846
+ const queryIndex = id.indexOf("?");
30847
+ if (queryIndex === -1) {
30848
+ return;
30849
+ }
30850
+ const rawQuery = id.slice(queryIndex + 1);
30851
+ const params = new URLSearchParams(rawQuery);
30852
+ if (!params.has("weapp-vite-vue")) {
30853
+ return;
30854
+ }
30855
+ if (params.get("type") !== "style") {
30856
+ return;
30857
+ }
30858
+ const indexRaw = params.get("index");
30859
+ const index = indexRaw ? Number(indexRaw) : 0;
30860
+ if (!Number.isFinite(index) || index < 0) {
30861
+ return;
30862
+ }
30863
+ let filename = id.slice(0, queryIndex);
30864
+ if (filename.startsWith(WEAPP_VUE_STYLE_VIRTUAL_PREFIX)) {
30865
+ const encoded = filename.slice(WEAPP_VUE_STYLE_VIRTUAL_PREFIX.length);
30866
+ if (!encoded) {
30867
+ return;
30868
+ }
30869
+ try {
30870
+ filename = decodeURIComponent(encoded);
30871
+ } catch {
30872
+ return;
30873
+ }
30874
+ }
30875
+ const normalizedFilename = normalizeFsResolvedId(filename);
30876
+ if (!normalizedFilename) {
30877
+ return;
30878
+ }
30879
+ return { filename: normalizedFilename, index };
30880
+ }
30881
+ function buildWeappVueStyleRequest(filename, styleBlock, index) {
30882
+ const lang = styleBlock.lang || "css";
30883
+ const normalizedFilename = normalizeFsResolvedId(filename);
30884
+ const encodedFilename = encodeURIComponent(normalizedFilename);
30885
+ let query = `weapp-vite-vue&type=style&index=${index}`;
30886
+ if (styleBlock.scoped) {
30887
+ query += "&scoped=true";
30888
+ }
30889
+ if (styleBlock.module) {
30890
+ query += typeof styleBlock.module === "string" ? `&module=${encodeURIComponent(styleBlock.module)}` : "&module=true";
30891
+ }
30892
+ query += `&lang.${lang}`;
30893
+ return `${WEAPP_VUE_STYLE_VIRTUAL_PREFIX}${encodedFilename}?${query}`;
30894
+ }
30895
+
30896
+ // src/plugins/vue/resolver.ts
30838
30897
  var VUE_VIRTUAL_MODULE_PREFIX2 = "\0vue:";
30839
30898
  var warnedMissingWevu = false;
30840
30899
  var wevuInstallState = "unknown";
@@ -30879,6 +30938,20 @@ function createVueResolverPlugin(ctx) {
30879
30938
  if (!configService) {
30880
30939
  return null;
30881
30940
  }
30941
+ const styleRequest = parseWeappVueStyleRequest(id);
30942
+ if (styleRequest) {
30943
+ ensureWevuInstalled(ctx);
30944
+ if (id.startsWith(WEAPP_VUE_STYLE_VIRTUAL_PREFIX)) {
30945
+ return id;
30946
+ }
30947
+ const absoluteId2 = toAbsoluteId(styleRequest.filename, configService, importer, { base: "srcRoot" });
30948
+ if (!absoluteId2) {
30949
+ return null;
30950
+ }
30951
+ const queryIndex = id.indexOf("?");
30952
+ const query = queryIndex === -1 ? "" : id.slice(queryIndex + 1);
30953
+ return query ? `${absoluteId2}?${query}` : absoluteId2;
30954
+ }
30882
30955
  if (id.endsWith(".vue")) {
30883
30956
  ensureWevuInstalled(ctx);
30884
30957
  const absoluteId2 = toAbsoluteId(id, configService, importer, { base: "srcRoot" });
@@ -31731,40 +31804,6 @@ async function emitVueBundleAssets(bundle, state) {
31731
31804
  }
31732
31805
  }
31733
31806
 
31734
- // src/plugins/vue/transform/styleRequest.ts
31735
- init_esm_shims();
31736
- function parseWeappVueStyleRequest(id) {
31737
- const [filename, rawQuery] = id.split("?", 2);
31738
- if (!rawQuery) {
31739
- return;
31740
- }
31741
- const params = new URLSearchParams(rawQuery);
31742
- if (!params.has("weapp-vite-vue")) {
31743
- return;
31744
- }
31745
- if (params.get("type") !== "style") {
31746
- return;
31747
- }
31748
- const indexRaw = params.get("index");
31749
- const index = indexRaw ? Number(indexRaw) : 0;
31750
- if (!Number.isFinite(index) || index < 0) {
31751
- return;
31752
- }
31753
- return { filename, index };
31754
- }
31755
- function buildWeappVueStyleRequest(filename, styleBlock, index) {
31756
- const lang = styleBlock.lang || "css";
31757
- let query = `weapp-vite-vue&type=style&index=${index}`;
31758
- if (styleBlock.scoped) {
31759
- query += "&scoped=true";
31760
- }
31761
- if (styleBlock.module) {
31762
- query += typeof styleBlock.module === "string" ? `&module=${encodeURIComponent(styleBlock.module)}` : "&module=true";
31763
- }
31764
- query += `&lang.${lang}`;
31765
- return `${filename}?${query}`;
31766
- }
31767
-
31768
31807
  // src/plugins/vue/transform/plugin.ts
31769
31808
  function createVueTransformPlugin(ctx) {
31770
31809
  const compilationCache = /* @__PURE__ */ new Map();
@@ -33150,7 +33189,7 @@ import path69 from "pathe";
33150
33189
  function createDependenciesCache(ctx) {
33151
33190
  function getDependenciesCacheFilePath(key = "/") {
33152
33191
  const configService = requireConfigService(ctx, "\u751F\u6210 npm \u7F13\u5B58\u8DEF\u5F84\u524D\u5FC5\u987B\u521D\u59CB\u5316 configService\u3002");
33153
- return path69.resolve(configService.cwd, `node_modules/weapp-vite/.cache/${key.replaceAll("/", "-")}.json`);
33192
+ return path69.resolve(configService.cwd, `node_modules/weapp-vite/.cache/${key.replace(/[\\/]/g, "-")}.json`);
33154
33193
  }
33155
33194
  function dependenciesCacheHash() {
33156
33195
  const configService = requireConfigService(ctx, "\u8BFB\u53D6\u4F9D\u8D56\u7F13\u5B58\u54C8\u5E0C\u524D\u5FC5\u987B\u521D\u59CB\u5316 configService\u3002");
@@ -34745,7 +34784,7 @@ function createScanService(ctx) {
34745
34784
  vueAppPath = await findVueEntry(appBasename);
34746
34785
  }
34747
34786
  if (!appConfigFile && vueAppPath) {
34748
- const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-J62WHPQK.mjs");
34787
+ const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-2KPXVEFZ.mjs");
34749
34788
  configFromVue = await extractConfigFromVue2(vueAppPath);
34750
34789
  if (configFromVue) {
34751
34790
  appConfigFile = vueAppPath;
@@ -2,10 +2,10 @@ import {
2
2
  getCompilerContext,
3
3
  resetCompilerContext,
4
4
  setActiveCompilerContextKey
5
- } from "./chunk-GWPIUN5P.mjs";
5
+ } from "./chunk-LYVEG4WY.mjs";
6
6
  import {
7
7
  init_esm_shims
8
- } from "./chunk-NWLNV653.mjs";
8
+ } from "./chunk-4VWZIUSC.mjs";
9
9
 
10
10
  // src/createContext.ts
11
11
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-NWLNV653.mjs";
3
+ } from "./chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/types/external.ts
6
6
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-NWLNV653.mjs";
3
+ } from "./chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/config.ts
6
6
  init_esm_shims();
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createCompilerContext
3
- } from "./chunk-HRQILEHJ.mjs";
3
+ } from "./chunk-PQTDFW2X.mjs";
4
4
  import {
5
5
  DEFAULT_MP_PLATFORM,
6
6
  SHARED_CHUNK_VIRTUAL_PREFIX,
@@ -13,13 +13,13 @@ import {
13
13
  normalizeMiniPlatform,
14
14
  resolveMiniPlatform,
15
15
  resolveWeappConfigFile
16
- } from "./chunk-GWPIUN5P.mjs";
16
+ } from "./chunk-LYVEG4WY.mjs";
17
17
  import {
18
18
  VERSION
19
- } from "./chunk-6CV4BK4W.mjs";
19
+ } from "./chunk-D2X6N3H6.mjs";
20
20
  import {
21
21
  init_esm_shims
22
- } from "./chunk-NWLNV653.mjs";
22
+ } from "./chunk-4VWZIUSC.mjs";
23
23
 
24
24
  // src/cli.ts
25
25
  init_esm_shims();
package/dist/config.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  defineConfig
3
- } from "./chunk-ASLGPJG2.mjs";
3
+ } from "./chunk-ZPJCXU6I.mjs";
4
4
  import {
5
5
  defineAppJson,
6
6
  defineComponentJson,
7
7
  definePageJson,
8
8
  defineSitemapJson,
9
9
  defineThemeJson
10
- } from "./chunk-4QBBC6UB.mjs";
11
- import "./chunk-NWLNV653.mjs";
10
+ } from "./chunk-EG5ZSUGT.mjs";
11
+ import "./chunk-4VWZIUSC.mjs";
12
12
  export {
13
13
  defineAppJson,
14
14
  defineComponentJson,
@@ -11,8 +11,8 @@ import {
11
11
  isTemplateRequest,
12
12
  touch,
13
13
  touchSync
14
- } from "./chunk-6CV4BK4W.mjs";
15
- import "./chunk-NWLNV653.mjs";
14
+ } from "./chunk-D2X6N3H6.mjs";
15
+ import "./chunk-4VWZIUSC.mjs";
16
16
  export {
17
17
  changeFileExtension,
18
18
  extractConfigFromVue,
package/dist/index.mjs CHANGED
@@ -1,26 +1,26 @@
1
- import "./chunk-P3YY74UW.mjs";
1
+ import "./chunk-X5OHU7L4.mjs";
2
2
  import {
3
3
  createCompilerContext
4
- } from "./chunk-HRQILEHJ.mjs";
4
+ } from "./chunk-PQTDFW2X.mjs";
5
5
  import {
6
6
  defineEmits,
7
7
  defineProps
8
- } from "./chunk-TMK6JVTT.mjs";
9
- import "./chunk-GWPIUN5P.mjs";
10
- import "./chunk-6CV4BK4W.mjs";
8
+ } from "./chunk-4EVKCID7.mjs";
9
+ import "./chunk-LYVEG4WY.mjs";
10
+ import "./chunk-D2X6N3H6.mjs";
11
11
  import {
12
12
  defineConfig
13
- } from "./chunk-ASLGPJG2.mjs";
13
+ } from "./chunk-ZPJCXU6I.mjs";
14
14
  import {
15
15
  defineAppJson,
16
16
  defineComponentJson,
17
17
  definePageJson,
18
18
  defineSitemapJson,
19
19
  defineThemeJson
20
- } from "./chunk-4QBBC6UB.mjs";
20
+ } from "./chunk-EG5ZSUGT.mjs";
21
21
  import {
22
22
  init_esm_shims
23
- } from "./chunk-NWLNV653.mjs";
23
+ } from "./chunk-4VWZIUSC.mjs";
24
24
 
25
25
  // src/index.ts
26
26
  init_esm_shims();
package/dist/json.mjs CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  definePageJson,
5
5
  defineSitemapJson,
6
6
  defineThemeJson
7
- } from "./chunk-4QBBC6UB.mjs";
8
- import "./chunk-NWLNV653.mjs";
7
+ } from "./chunk-EG5ZSUGT.mjs";
8
+ import "./chunk-4VWZIUSC.mjs";
9
9
  export {
10
10
  defineAppJson,
11
11
  defineComponentJson,
package/dist/runtime.mjs CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  createWevuComponent,
3
3
  defineEmits,
4
4
  defineProps
5
- } from "./chunk-TMK6JVTT.mjs";
6
- import "./chunk-NWLNV653.mjs";
5
+ } from "./chunk-4EVKCID7.mjs";
6
+ import "./chunk-4VWZIUSC.mjs";
7
7
  export {
8
8
  createWevuComponent,
9
9
  defineEmits,
package/dist/types.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import "./chunk-P3YY74UW.mjs";
1
+ import "./chunk-X5OHU7L4.mjs";
2
2
  import {
3
3
  init_esm_shims
4
- } from "./chunk-NWLNV653.mjs";
4
+ } from "./chunk-4VWZIUSC.mjs";
5
5
 
6
6
  // src/types/index.ts
7
7
  init_esm_shims();
package/dist/volar.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-NWLNV653.mjs";
3
+ } from "./chunk-4VWZIUSC.mjs";
4
4
 
5
5
  // src/volar.ts
6
6
  init_esm_shims();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "6.4.4",
4
+ "version": "6.4.6",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -103,15 +103,15 @@
103
103
  "vite-tsconfig-paths": "^6.0.5",
104
104
  "vue": "^3.5.27",
105
105
  "@weapp-core/init": "6.0.0",
106
- "@weapp-core/schematics": "6.0.1",
107
106
  "@weapp-core/logger": "3.0.2",
108
107
  "@weapp-core/shared": "3.0.0",
108
+ "@weapp-core/schematics": "6.0.1",
109
109
  "@weapp-vite/volar": "2.0.3",
110
110
  "@weapp-vite/web": "1.2.0",
111
- "rolldown-require": "2.0.1",
112
111
  "vite-plugin-performance": "2.0.0",
113
112
  "weapp-ide-cli": "5.0.0",
114
- "wevu": "2.1.2"
113
+ "wevu": "2.1.3",
114
+ "rolldown-require": "2.0.2"
115
115
  },
116
116
  "publishConfig": {
117
117
  "access": "public",