weapp-vite 3.0.2 → 3.1.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.
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkRJF2LDZWcjs = require('../chunk-RJF2LDZW.cjs');
4
+ var _chunk3HEEBJ57cjs = require('../chunk-3HEEBJ57.cjs');
5
5
 
6
6
  // src/auto-import-components/resolvers/index.ts
7
- _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
7
+ _chunk3HEEBJ57cjs.init_cjs_shims.call(void 0, );
8
8
 
9
9
  // src/auto-import-components/resolvers/tdesign.ts
10
- _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
10
+ _chunk3HEEBJ57cjs.init_cjs_shims.call(void 0, );
11
11
  var _shared = require('@weapp-core/shared');
12
12
 
13
13
  // src/auto-import-components/resolvers/json/tdesign.json
@@ -92,7 +92,7 @@ var tdesign_default = [
92
92
 
93
93
  // src/auto-import-components/resolvers/tdesign.ts
94
94
  var defaultPrefix = "t-";
95
- var TDesignResolver = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (opts) => {
95
+ var TDesignResolver = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (opts) => {
96
96
  const { prefix, resolve } = _shared.defu.call(void 0, opts, {
97
97
  prefix: defaultPrefix,
98
98
  resolve({ name, prefix: prefix2 }) {
@@ -123,10 +123,10 @@ var TDesignResolver = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (opt
123
123
  }, "TDesignResolver");
124
124
 
125
125
  // src/auto-import-components/resolvers/types.ts
126
- _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
126
+ _chunk3HEEBJ57cjs.init_cjs_shims.call(void 0, );
127
127
 
128
128
  // src/auto-import-components/resolvers/vant.ts
129
- _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
129
+ _chunk3HEEBJ57cjs.init_cjs_shims.call(void 0, );
130
130
 
131
131
 
132
132
  // src/auto-import-components/resolvers/json/vant.json
@@ -204,7 +204,7 @@ var vant_default = [
204
204
 
205
205
  // src/auto-import-components/resolvers/vant.ts
206
206
  var defaultPrefix2 = "van-";
207
- var VantResolver = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (opts) => {
207
+ var VantResolver = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (opts) => {
208
208
  const { prefix, resolve } = _shared.defu.call(void 0, opts, {
209
209
  prefix: defaultPrefix2,
210
210
  resolve({ name, prefix: prefix2 }) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  __name,
3
3
  init_esm_shims
4
- } from "../chunk-J4FW3JHK.mjs";
4
+ } from "../chunk-SNYFQNMQ.mjs";
5
5
 
6
6
  // src/auto-import-components/resolvers/index.ts
7
7
  init_esm_shims();
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  mod
29
29
  ));
30
30
 
31
- // ../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.11_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
31
+ // ../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.13_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
32
32
  var getImportMetaUrl, importMetaUrl;
33
33
  var init_cjs_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.11_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.4.0_@swc+core@1.11.13_jiti@2.4.2_postcss@8.5.3_tsx@4.19.3_typescript@5.8.2_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
35
35
  "use strict";
36
36
  getImportMetaUrl = /* @__PURE__ */ __name(() => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href, "getImportMetaUrl");
37
37
  importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -1,23 +1,23 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunkRJF2LDZWcjs = require('./chunk-RJF2LDZW.cjs');
4
+ var _chunk3HEEBJ57cjs = require('./chunk-3HEEBJ57.cjs');
5
5
 
6
6
  // src/json.ts
7
- _chunkRJF2LDZWcjs.init_cjs_shims.call(void 0, );
8
- var defineAppJson = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (config) => {
7
+ _chunk3HEEBJ57cjs.init_cjs_shims.call(void 0, );
8
+ var defineAppJson = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (config) => {
9
9
  return config;
10
10
  }, "defineAppJson");
11
- var definePageJson = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (config) => {
11
+ var definePageJson = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (config) => {
12
12
  return config;
13
13
  }, "definePageJson");
14
- var defineComponentJson = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (config) => {
14
+ var defineComponentJson = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (config) => {
15
15
  return config;
16
16
  }, "defineComponentJson");
17
- var defineSitemapJson = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (config) => {
17
+ var defineSitemapJson = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (config) => {
18
18
  return config;
19
19
  }, "defineSitemapJson");
20
- var defineThemeJson = /* @__PURE__ */ _chunkRJF2LDZWcjs.__name.call(void 0, (config) => {
20
+ var defineThemeJson = /* @__PURE__ */ _chunk3HEEBJ57cjs.__name.call(void 0, (config) => {
21
21
  return config;
22
22
  }, "defineThemeJson");
23
23
 
@@ -3,7 +3,7 @@ import {
3
3
  __name,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-J4FW3JHK.mjs";
6
+ } from "./chunk-SNYFQNMQ.mjs";
7
7
 
8
8
  // ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
9
9
  var require_Reflect = __commonJS({
@@ -3729,6 +3729,11 @@ __name(getProjectConfig, "getProjectConfig");
3729
3729
 
3730
3730
  // src/utils/regexp.ts
3731
3731
  init_esm_shims();
3732
+ var CSS_LANGS_RE = /\.(wxss|css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
3733
+ function isCSSRequest(request) {
3734
+ return CSS_LANGS_RE.test(request);
3735
+ }
3736
+ __name(isCSSRequest, "isCSSRequest");
3732
3737
  function isRegexp(value) {
3733
3738
  return Object.prototype.toString.call(value) === "[object RegExp]";
3734
3739
  }
@@ -21836,7 +21841,6 @@ import { fdir as Fdir } from "fdir";
21836
21841
  import fs4 from "fs-extra";
21837
21842
  var import_merge = __toESM(require_src(), 1);
21838
21843
  import path7 from "pathe";
21839
- import { isCSSRequest } from "vite";
21840
21844
 
21841
21845
  // src/plugins/parse.ts
21842
21846
  init_esm_shims();
@@ -21869,6 +21873,9 @@ function isTemplateRequest(request) {
21869
21873
  return request.endsWith(".wxml") || request.endsWith(".html");
21870
21874
  }
21871
21875
  __name(isTemplateRequest, "isTemplateRequest");
21876
+ var removePlugins = [
21877
+ "vite:build-import-analysis"
21878
+ ];
21872
21879
  var VitePluginService = class {
21873
21880
  static {
21874
21881
  __name(this, "VitePluginService");
@@ -21889,9 +21896,11 @@ var VitePluginService = class {
21889
21896
  this.cachedWorkerFiles = [];
21890
21897
  }
21891
21898
  configResolved(config) {
21892
- const idx = config.plugins?.findIndex((x3) => x3.name === "vite:build-import-analysis");
21893
- if (idx > -1) {
21894
- config.plugins.splice(idx, 1);
21899
+ for (const removePlugin of removePlugins) {
21900
+ const idx = config.plugins?.findIndex((x3) => x3.name === removePlugin);
21901
+ if (idx > -1) {
21902
+ config.plugins.splice(idx, 1);
21903
+ }
21895
21904
  }
21896
21905
  this.resolvedConfig = config;
21897
21906
  if (isObject3(this.resolvedConfig.env)) {
@@ -22185,9 +22194,16 @@ var VitePluginService = class {
22185
22194
  }
22186
22195
  debug2?.("buildEnd end");
22187
22196
  }
22188
- resolveId(id) {
22197
+ resolveId(id, _importer, options) {
22189
22198
  if (id.endsWith(".wxss")) {
22190
22199
  return id.replace(/\.wxss$/, ".css?wxss");
22200
+ } else if (options.custom?.requireTokens) {
22201
+ return {
22202
+ id,
22203
+ meta: {
22204
+ requireTokens: options.custom?.requireTokens
22205
+ }
22206
+ };
22191
22207
  }
22192
22208
  }
22193
22209
  async load(id, pluginContext) {
@@ -22289,8 +22305,8 @@ function vitePluginWeapp(ctx, subPackageMeta) {
22289
22305
  buildEnd() {
22290
22306
  return service.buildEnd(this);
22291
22307
  },
22292
- resolveId(id) {
22293
- return service.resolveId(id);
22308
+ resolveId(id, importer, options) {
22309
+ return service.resolveId(id, importer, options);
22294
22310
  },
22295
22311
  load(id) {
22296
22312
  return service.load(id, this);
@@ -22299,6 +22315,8 @@ function vitePluginWeapp(ctx, subPackageMeta) {
22299
22315
  watchChange(id, change) {
22300
22316
  return service.watchChange(id, change);
22301
22317
  },
22318
+ writeBundle() {
22319
+ },
22302
22320
  generateBundle(_options, bundle) {
22303
22321
  return service.generateBundle(bundle, this);
22304
22322
  }
@@ -22480,6 +22498,7 @@ __name(isMetadataYarnClassic, "isMetadataYarnClassic");
22480
22498
  // src/context/services/ConfigService.ts
22481
22499
  import path9 from "pathe";
22482
22500
  import { loadConfigFromFile } from "vite";
22501
+ import commonjs from "vite-plugin-commonjs";
22483
22502
  import tsconfigPaths from "vite-tsconfig-paths";
22484
22503
  function _ts_decorate4(decorators, target, key, desc) {
22485
22504
  var c2 = arguments.length, r4 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
@@ -22562,6 +22581,7 @@ async function loadConfig(opts) {
22562
22581
  const platform = config.weapp?.platform ?? "weapp";
22563
22582
  const outputExtensions = getOutputExtensions(platform);
22564
22583
  config.plugins ??= [];
22584
+ config.plugins?.push(commonjs(config.weapp?.commonjs));
22565
22585
  config.plugins?.push(tsconfigPaths(config.weapp?.tsconfigPaths));
22566
22586
  const aliasEntries = getAliasEntries(config.weapp?.jsonAlias);
22567
22587
  return {
@@ -23240,7 +23260,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
23240
23260
  // ../../node_modules/.pnpm/mlly@1.7.4/node_modules/mlly/dist/index.mjs
23241
23261
  init_esm_shims();
23242
23262
 
23243
- // ../../node_modules/.pnpm/acorn@8.14.0/node_modules/acorn/dist/acorn.mjs
23263
+ // ../../node_modules/.pnpm/acorn@8.14.1/node_modules/acorn/dist/acorn.mjs
23244
23264
  init_esm_shims();
23245
23265
  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
23246
23266
  var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
@@ -23673,6 +23693,7 @@ var SCOPE_SIMPLE_CATCH = 32;
23673
23693
  var SCOPE_SUPER = 64;
23674
23694
  var SCOPE_DIRECT_SUPER = 128;
23675
23695
  var SCOPE_CLASS_STATIC_BLOCK = 256;
23696
+ var SCOPE_CLASS_FIELD_INIT = 512;
23676
23697
  var SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;
23677
23698
  function functionFlags(async, generator) {
23678
23699
  return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0);
@@ -23742,19 +23763,20 @@ prototypeAccessors.inFunction.get = function() {
23742
23763
  return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
23743
23764
  };
23744
23765
  prototypeAccessors.inGenerator.get = function() {
23745
- return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 && !this.currentVarScope().inClassFieldInit;
23766
+ return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0;
23746
23767
  };
23747
23768
  prototypeAccessors.inAsync.get = function() {
23748
- return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 && !this.currentVarScope().inClassFieldInit;
23769
+ return (this.currentVarScope().flags & SCOPE_ASYNC) > 0;
23749
23770
  };
23750
23771
  prototypeAccessors.canAwait.get = function() {
23751
23772
  for (var i = this.scopeStack.length - 1; i >= 0; i--) {
23752
- var scope = this.scopeStack[i];
23753
- if (scope.inClassFieldInit || scope.flags & SCOPE_CLASS_STATIC_BLOCK) {
23773
+ var ref2 = this.scopeStack[i];
23774
+ var flags = ref2.flags;
23775
+ if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) {
23754
23776
  return false;
23755
23777
  }
23756
- if (scope.flags & SCOPE_FUNCTION) {
23757
- return (scope.flags & SCOPE_ASYNC) > 0;
23778
+ if (flags & SCOPE_FUNCTION) {
23779
+ return (flags & SCOPE_ASYNC) > 0;
23758
23780
  }
23759
23781
  }
23760
23782
  return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
@@ -23762,8 +23784,7 @@ prototypeAccessors.canAwait.get = function() {
23762
23784
  prototypeAccessors.allowSuper.get = function() {
23763
23785
  var ref2 = this.currentThisScope();
23764
23786
  var flags = ref2.flags;
23765
- var inClassFieldInit = ref2.inClassFieldInit;
23766
- return (flags & SCOPE_SUPER) > 0 || inClassFieldInit || this.options.allowSuperOutsideMethod;
23787
+ return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod;
23767
23788
  };
23768
23789
  prototypeAccessors.allowDirectSuper.get = function() {
23769
23790
  return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
@@ -23772,10 +23793,14 @@ prototypeAccessors.treatFunctionsAsVar.get = function() {
23772
23793
  return this.treatFunctionsAsVarInScope(this.currentScope());
23773
23794
  };
23774
23795
  prototypeAccessors.allowNewDotTarget.get = function() {
23775
- var ref2 = this.currentThisScope();
23776
- var flags = ref2.flags;
23777
- var inClassFieldInit = ref2.inClassFieldInit;
23778
- return (flags & (SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK)) > 0 || inClassFieldInit;
23796
+ for (var i = this.scopeStack.length - 1; i >= 0; i--) {
23797
+ var ref2 = this.scopeStack[i];
23798
+ var flags = ref2.flags;
23799
+ if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) || flags & SCOPE_FUNCTION && !(flags & SCOPE_ARROW)) {
23800
+ return true;
23801
+ }
23802
+ }
23803
+ return false;
23779
23804
  };
23780
23805
  prototypeAccessors.inClassStaticBlock.get = function() {
23781
23806
  return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0;
@@ -24618,11 +24643,9 @@ pp$8.parseClassField = function(field) {
24618
24643
  this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
24619
24644
  }
24620
24645
  if (this.eat(types$1.eq)) {
24621
- var scope = this.currentThisScope();
24622
- var inClassFieldInit = scope.inClassFieldInit;
24623
- scope.inClassFieldInit = true;
24646
+ this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
24624
24647
  field.value = this.parseMaybeAssign();
24625
- scope.inClassFieldInit = inClassFieldInit;
24648
+ this.exitScope();
24626
24649
  } else {
24627
24650
  field.value = null;
24628
24651
  }
@@ -24747,6 +24770,9 @@ pp$8.parseExport = function(node, exports) {
24747
24770
  }
24748
24771
  node.specifiers = [];
24749
24772
  node.source = null;
24773
+ if (this.options.ecmaVersion >= 16) {
24774
+ node.attributes = [];
24775
+ }
24750
24776
  } else {
24751
24777
  node.declaration = null;
24752
24778
  node.specifiers = this.parseExportSpecifiers(exports);
@@ -24768,6 +24794,9 @@ pp$8.parseExport = function(node, exports) {
24768
24794
  }
24769
24795
  }
24770
24796
  node.source = null;
24797
+ if (this.options.ecmaVersion >= 16) {
24798
+ node.attributes = [];
24799
+ }
24771
24800
  }
24772
24801
  this.semicolon();
24773
24802
  }
@@ -26129,9 +26158,10 @@ pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
26129
26158
  return this.finishNode(prop, "Property");
26130
26159
  };
26131
26160
  pp$5.parseGetterSetter = function(prop) {
26132
- prop.kind = prop.key.name;
26161
+ var kind = prop.key.name;
26133
26162
  this.parsePropertyName(prop);
26134
26163
  prop.value = this.parseMethod(false);
26164
+ prop.kind = kind;
26135
26165
  var paramCount = prop.kind === "get" ? 0 : 1;
26136
26166
  if (prop.value.params.length !== paramCount) {
26137
26167
  var start = prop.value.start;
@@ -26157,9 +26187,9 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
26157
26187
  if (isPattern) {
26158
26188
  this.unexpected();
26159
26189
  }
26160
- prop.kind = "init";
26161
26190
  prop.method = true;
26162
26191
  prop.value = this.parseMethod(isGenerator, isAsync);
26192
+ prop.kind = "init";
26163
26193
  } else if (!isPattern && !containsEsc && this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
26164
26194
  if (isGenerator || isAsync) {
26165
26195
  this.unexpected();
@@ -26173,7 +26203,6 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
26173
26203
  if (prop.key.name === "await" && !this.awaitIdentPos) {
26174
26204
  this.awaitIdentPos = startPos;
26175
26205
  }
26176
- prop.kind = "init";
26177
26206
  if (isPattern) {
26178
26207
  prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
26179
26208
  } else if (this.type === types$1.eq && refDestructuringErrors) {
@@ -26184,6 +26213,7 @@ pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startP
26184
26213
  } else {
26185
26214
  prop.value = this.copyNode(prop.key);
26186
26215
  }
26216
+ prop.kind = "init";
26187
26217
  prop.shorthand = true;
26188
26218
  } else {
26189
26219
  this.unexpected();
@@ -26333,7 +26363,7 @@ pp$5.checkUnreserved = function(ref2) {
26333
26363
  if (this.inAsync && name === "await") {
26334
26364
  this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function");
26335
26365
  }
26336
- if (this.currentThisScope().inClassFieldInit && name === "arguments") {
26366
+ if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments") {
26337
26367
  this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer");
26338
26368
  }
26339
26369
  if (this.inClassStaticBlock && (name === "arguments" || name === "await")) {
@@ -26426,6 +26456,9 @@ var pp$4 = Parser2.prototype;
26426
26456
  pp$4.raise = function(pos, message) {
26427
26457
  var loc = getLineInfo(this.input, pos);
26428
26458
  message += " (" + loc.line + ":" + loc.column + ")";
26459
+ if (this.sourceFile) {
26460
+ message += " in " + this.sourceFile;
26461
+ }
26429
26462
  var err = new SyntaxError(message);
26430
26463
  err.pos = pos;
26431
26464
  err.loc = loc;
@@ -26444,7 +26477,6 @@ var Scope = /* @__PURE__ */ __name(function Scope2(flags) {
26444
26477
  this.var = [];
26445
26478
  this.lexical = [];
26446
26479
  this.functions = [];
26447
- this.inClassFieldInit = false;
26448
26480
  }, "Scope");
26449
26481
  pp$3.enterScope = function(flags) {
26450
26482
  this.scopeStack.push(new Scope(flags));
@@ -26506,7 +26538,7 @@ pp$3.currentScope = function() {
26506
26538
  pp$3.currentVarScope = function() {
26507
26539
  for (var i = this.scopeStack.length - 1; ; i--) {
26508
26540
  var scope = this.scopeStack[i];
26509
- if (scope.flags & SCOPE_VAR) {
26541
+ if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) {
26510
26542
  return scope;
26511
26543
  }
26512
26544
  }
@@ -26514,7 +26546,7 @@ pp$3.currentVarScope = function() {
26514
26546
  pp$3.currentThisScope = function() {
26515
26547
  for (var i = this.scopeStack.length - 1; ; i--) {
26516
26548
  var scope = this.scopeStack[i];
26517
- if (scope.flags & SCOPE_VAR && !(scope.flags & SCOPE_ARROW)) {
26549
+ if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) && !(scope.flags & SCOPE_ARROW)) {
26518
26550
  return scope;
26519
26551
  }
26520
26552
  }
@@ -28783,7 +28815,7 @@ pp.readWord = function() {
28783
28815
  }
28784
28816
  return this.finishToken(type, word);
28785
28817
  };
28786
- var version2 = "8.14.0";
28818
+ var version2 = "8.14.1";
28787
28819
  Parser2.acorn = {
28788
28820
  Parser: Parser2,
28789
28821
  version: version2,
@@ -30883,7 +30915,7 @@ var ScanService2 = class {
30883
30915
  } else if (tokens[0] === "") {
30884
30916
  await this.scanComponentEntry({
30885
30917
  componentEntry: componentUrl.substring(1),
30886
- dirname: path15.resolve(this.configService.cwd, this.configService.srcRoot),
30918
+ dirname: this.configService.absoluteSrcRoot,
30887
30919
  subPackageMeta
30888
30920
  });
30889
30921
  } else {
@@ -30909,7 +30941,7 @@ var ScanService2 = class {
30909
30941
  this.wxmlService.wxmlComponentsMap.clear();
30910
30942
  }
30911
30943
  async loadAppEntry() {
30912
- const appDirname = path15.resolve(this.configService.cwd, this.configService.srcRoot);
30944
+ const appDirname = this.configService.absoluteSrcRoot;
30913
30945
  const appBasename = path15.resolve(appDirname, "app");
30914
30946
  const appConfigFile = await findJsonEntry(appBasename);
30915
30947
  const appEntryPath = await findJsEntry(appBasename);
@@ -30944,10 +30976,14 @@ var ScanService2 = class {
30944
30976
  throw new Error(`\u5728 ${appDirname} \u76EE\u5F55\u4E0B\u6CA1\u6709\u627E\u5230 \`app.json\`, \u8BF7\u786E\u4FDD\u4F60\u521D\u59CB\u5316\u4E86\u5C0F\u7A0B\u5E8F\u9879\u76EE\uFF0C\u6216\u8005\u5728 \`vite.config.ts\` \u4E2D\u8BBE\u7F6E\u7684\u6B63\u786E\u7684 \`weapp.srcRoot\` \u914D\u7F6E\u8DEF\u5F84 `);
30945
30977
  }
30946
30978
  }
30979
+ // loadPageEntry(p: string) {
30980
+ // }
30981
+ // loadComponentEntry(p: string) {
30982
+ // }
30947
30983
  async scanAppEntry() {
30948
30984
  debug?.("scanAppEntry start");
30949
30985
  this.resetEntries();
30950
- const appDirname = path15.resolve(this.configService.cwd, this.configService.srcRoot);
30986
+ const appDirname = this.configService.absoluteSrcRoot;
30951
30987
  if (this.appEntry) {
30952
30988
  const { path: appEntryPath, json: config } = this.appEntry;
30953
30989
  if (this.entriesSet.has(appEntryPath)) {