@forsakringskassan/vite-lib-config 2.3.0 → 3.0.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.
@@ -331,9 +331,9 @@ var require_supports_color = __commonJS({
331
331
  }
332
332
  });
333
333
 
334
- // internal/plugin-vue3/node_modules/@vitejs/plugin-vue/dist/index.cjs
334
+ // node_modules/@vitejs/plugin-vue/dist/index.cjs
335
335
  var require_dist = __commonJS({
336
- "internal/plugin-vue3/node_modules/@vitejs/plugin-vue/dist/index.cjs"(exports2, module2) {
336
+ "node_modules/@vitejs/plugin-vue/dist/index.cjs"(exports2, module2) {
337
337
  "use strict";
338
338
  Object.defineProperty(exports2, "__esModule", { value: true });
339
339
  var fs4 = require("node:fs");
@@ -341,7 +341,7 @@ var require_dist = __commonJS({
341
341
  var vue = require("vue");
342
342
  var node_module = require("node:module");
343
343
  var path4 = require("node:path");
344
- var node_crypto = require("node:crypto");
344
+ var crypto = require("node:crypto");
345
345
  var require$$0 = require("tty");
346
346
  var require$$1 = require("util");
347
347
  var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
@@ -350,9 +350,10 @@ var require_dist = __commonJS({
350
350
  }
351
351
  var fs__default = /* @__PURE__ */ _interopDefaultCompat(fs4);
352
352
  var path__default = /* @__PURE__ */ _interopDefaultCompat(path4);
353
+ var crypto__default = /* @__PURE__ */ _interopDefaultCompat(crypto);
353
354
  var require$$0__default = /* @__PURE__ */ _interopDefaultCompat(require$$0);
354
355
  var require$$1__default = /* @__PURE__ */ _interopDefaultCompat(require$$1);
355
- var version2 = "4.6.2";
356
+ var version2 = "5.2.1";
356
357
  function resolveCompiler(root) {
357
358
  const compiler = tryResolveCompiler(root) || tryResolveCompiler();
358
359
  if (!compiler) {
@@ -399,25 +400,38 @@ var require_dist = __commonJS({
399
400
  query
400
401
  };
401
402
  }
402
- function slash(path5) {
403
- const isExtendedLengthPath = path5.startsWith("\\\\?\\");
404
- if (isExtendedLengthPath) {
405
- return path5;
406
- }
407
- return path5.replace(/\\/g, "/");
408
- }
409
403
  var cache = /* @__PURE__ */ new Map();
410
404
  var hmrCache = /* @__PURE__ */ new Map();
411
405
  var prevCache = /* @__PURE__ */ new Map();
412
- function createDescriptor(filename, source, { root, isProduction, sourceMap, compiler, template }, hmr = false) {
406
+ function createDescriptor(filename, source, {
407
+ root,
408
+ isProduction,
409
+ sourceMap,
410
+ compiler,
411
+ template,
412
+ features
413
+ }, hmr = false) {
413
414
  const { descriptor, errors } = compiler.parse(source, {
414
415
  filename,
415
416
  sourceMap,
416
- // @ts-ignore only available in Vue 3.4+
417
417
  templateParseOptions: template?.compilerOptions
418
418
  });
419
- const normalizedPath = slash(path__default.normalize(path__default.relative(root, filename)));
420
- descriptor.id = getHash(normalizedPath + (isProduction ? source : ""));
419
+ const normalizedPath = vite.normalizePath(path__default.relative(root, filename));
420
+ const componentIdGenerator = features?.componentIdGenerator;
421
+ if (componentIdGenerator === "filepath") {
422
+ descriptor.id = getHash(normalizedPath);
423
+ } else if (componentIdGenerator === "filepath-source") {
424
+ descriptor.id = getHash(normalizedPath + source);
425
+ } else if (typeof componentIdGenerator === "function") {
426
+ descriptor.id = componentIdGenerator(
427
+ normalizedPath,
428
+ source,
429
+ isProduction,
430
+ getHash
431
+ );
432
+ } else {
433
+ descriptor.id = getHash(normalizedPath + (isProduction ? source : ""));
434
+ }
421
435
  (hmr ? hmrCache : cache).set(filename, descriptor);
422
436
  return { descriptor, errors };
423
437
  }
@@ -477,8 +491,19 @@ var require_dist = __commonJS({
477
491
  }
478
492
  cache.set(filename, entry);
479
493
  }
494
+ var hash = (
495
+ // eslint-disable-next-line n/no-unsupported-features/node-builtins -- crypto.hash is supported in Node 21.7.0+, 20.12.0+
496
+ crypto__default.hash ?? ((algorithm, data, outputEncoding) => crypto__default.createHash(algorithm).update(data).digest(outputEncoding))
497
+ );
480
498
  function getHash(text) {
481
- return node_crypto.createHash("sha256").update(text).digest("hex").substring(0, 8);
499
+ return hash("sha256", text, "hex").substring(0, 8);
500
+ }
501
+ function slash(path5) {
502
+ const isExtendedLengthPath = path5.startsWith("\\\\?\\");
503
+ if (isExtendedLengthPath) {
504
+ return path5;
505
+ }
506
+ return path5.replace(/\\/g, "/");
482
507
  }
483
508
  function createRollupError(id, error) {
484
509
  const { message, name, stack } = error;
@@ -570,7 +595,8 @@ import.meta.hot.accept(({ render }) => {
570
595
  const { id, filename, cssVars } = descriptor;
571
596
  let transformAssetUrls = options.template?.transformAssetUrls;
572
597
  let assetUrlOptions;
573
- if (options.devServer) {
598
+ if (transformAssetUrls === false) ;
599
+ else if (options.devServer) {
574
600
  if (filename.startsWith(options.root)) {
575
601
  const devBase = options.devServer.config.base;
576
602
  assetUrlOptions = {
@@ -578,7 +604,7 @@ import.meta.hot.accept(({ render }) => {
578
604
  includeAbsolute: !!devBase
579
605
  };
580
606
  }
581
- } else if (transformAssetUrls !== false) {
607
+ } else {
582
608
  assetUrlOptions = {
583
609
  includeAbsolute: true
584
610
  };
@@ -610,7 +636,6 @@ import.meta.hot.accept(({ render }) => {
610
636
  return {
611
637
  ...options.template,
612
638
  id,
613
- // @ts-ignore only available in vue 3.4+
614
639
  ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
615
640
  filename,
616
641
  scoped: hasScoped,
@@ -656,16 +681,19 @@ import.meta.hot.accept(({ render }) => {
656
681
  function setResolvedScript(descriptor, script, ssr) {
657
682
  (ssr ? ssrCache : clientCache).set(descriptor, script);
658
683
  }
659
- function isUseInlineTemplate(descriptor, isProd) {
660
- return isProd && !!descriptor.scriptSetup && !descriptor.template?.src;
684
+ function clearScriptCache() {
685
+ clientCache = /* @__PURE__ */ new WeakMap();
686
+ ssrCache = /* @__PURE__ */ new WeakMap();
687
+ }
688
+ function isUseInlineTemplate(descriptor, options) {
689
+ return !options.devServer && !options.devToolsEnabled && !!descriptor.scriptSetup && !descriptor.template?.src;
661
690
  }
662
691
  var scriptIdentifier = `_sfc_main`;
663
692
  function resolveScript(descriptor, options, ssr, customElement) {
664
693
  if (!descriptor.script && !descriptor.scriptSetup) {
665
694
  return null;
666
695
  }
667
- const cacheToUse = ssr ? ssrCache : clientCache;
668
- const cached = cacheToUse.get(descriptor);
696
+ const cached = getResolvedScript(descriptor, ssr);
669
697
  if (cached) {
670
698
  return cached;
671
699
  }
@@ -674,12 +702,12 @@ import.meta.hot.accept(({ render }) => {
674
702
  ...options.script,
675
703
  id: descriptor.id,
676
704
  isProd: options.isProduction,
677
- inlineTemplate: isUseInlineTemplate(descriptor, !options.devServer),
678
- reactivityTransform: options.reactivityTransform !== false,
705
+ inlineTemplate: isUseInlineTemplate(descriptor, options),
679
706
  templateOptions: resolveTemplateCompilerOptions(descriptor, options, ssr),
680
707
  sourceMap: options.sourceMap,
681
708
  genDefaultAs: canInlineMain(descriptor, options) ? scriptIdentifier : void 0,
682
- customElement
709
+ customElement,
710
+ propsDestructure: options.features?.propsDestructure ?? options.script?.propsDestructure
683
711
  });
684
712
  if (!options.isProduction && resolved?.deps) {
685
713
  for (const [key, sfcs] of typeDepToSFCMap) {
@@ -696,7 +724,7 @@ import.meta.hot.accept(({ render }) => {
696
724
  }
697
725
  }
698
726
  }
699
- cacheToUse.set(descriptor, resolved);
727
+ setResolvedScript(descriptor, resolved, ssr);
700
728
  return resolved;
701
729
  }
702
730
  function canInlineMain(descriptor, options) {
@@ -722,6 +750,41 @@ import.meta.hot.accept(({ render }) => {
722
750
  intToChar[i] = c;
723
751
  charToInt[c] = i;
724
752
  }
753
+ function decodeInteger(reader, relative) {
754
+ let value = 0;
755
+ let shift = 0;
756
+ let integer = 0;
757
+ do {
758
+ const c = reader.next();
759
+ integer = charToInt[c];
760
+ value |= (integer & 31) << shift;
761
+ shift += 5;
762
+ } while (integer & 32);
763
+ const shouldNegate = value & 1;
764
+ value >>>= 1;
765
+ if (shouldNegate) {
766
+ value = -2147483648 | -value;
767
+ }
768
+ return relative + value;
769
+ }
770
+ function encodeInteger(builder, num, relative) {
771
+ let delta = num - relative;
772
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
773
+ do {
774
+ let clamped = delta & 31;
775
+ delta >>>= 5;
776
+ if (delta > 0)
777
+ clamped |= 32;
778
+ builder.write(intToChar[clamped]);
779
+ } while (delta > 0);
780
+ return num;
781
+ }
782
+ function hasMoreVlq(reader, max) {
783
+ if (reader.pos >= max)
784
+ return false;
785
+ return reader.peek() !== comma;
786
+ }
787
+ var bufLength = 1024 * 16;
725
788
  var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
726
789
  decode(buf) {
727
790
  const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
@@ -736,72 +799,86 @@ import.meta.hot.accept(({ render }) => {
736
799
  return out;
737
800
  }
738
801
  };
802
+ var StringWriter = class {
803
+ constructor() {
804
+ this.pos = 0;
805
+ this.out = "";
806
+ this.buffer = new Uint8Array(bufLength);
807
+ }
808
+ write(v) {
809
+ const { buffer } = this;
810
+ buffer[this.pos++] = v;
811
+ if (this.pos === bufLength) {
812
+ this.out += td.decode(buffer);
813
+ this.pos = 0;
814
+ }
815
+ }
816
+ flush() {
817
+ const { buffer, out, pos } = this;
818
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
819
+ }
820
+ };
821
+ var StringReader = class {
822
+ constructor(buffer) {
823
+ this.pos = 0;
824
+ this.buffer = buffer;
825
+ }
826
+ next() {
827
+ return this.buffer.charCodeAt(this.pos++);
828
+ }
829
+ peek() {
830
+ return this.buffer.charCodeAt(this.pos);
831
+ }
832
+ indexOf(char) {
833
+ const { buffer, pos } = this;
834
+ const idx = buffer.indexOf(char, pos);
835
+ return idx === -1 ? buffer.length : idx;
836
+ }
837
+ };
739
838
  function decode(mappings) {
740
- const state = new Int32Array(5);
839
+ const { length } = mappings;
840
+ const reader = new StringReader(mappings);
741
841
  const decoded = [];
742
- let index = 0;
842
+ let genColumn = 0;
843
+ let sourcesIndex = 0;
844
+ let sourceLine = 0;
845
+ let sourceColumn = 0;
846
+ let namesIndex = 0;
743
847
  do {
744
- const semi = indexOf(mappings, index);
848
+ const semi = reader.indexOf(";");
745
849
  const line = [];
746
850
  let sorted = true;
747
851
  let lastCol = 0;
748
- state[0] = 0;
749
- for (let i = index; i < semi; i++) {
852
+ genColumn = 0;
853
+ while (reader.pos < semi) {
750
854
  let seg;
751
- i = decodeInteger(mappings, i, state, 0);
752
- const col = state[0];
753
- if (col < lastCol)
855
+ genColumn = decodeInteger(reader, genColumn);
856
+ if (genColumn < lastCol)
754
857
  sorted = false;
755
- lastCol = col;
756
- if (hasMoreVlq(mappings, i, semi)) {
757
- i = decodeInteger(mappings, i, state, 1);
758
- i = decodeInteger(mappings, i, state, 2);
759
- i = decodeInteger(mappings, i, state, 3);
760
- if (hasMoreVlq(mappings, i, semi)) {
761
- i = decodeInteger(mappings, i, state, 4);
762
- seg = [col, state[1], state[2], state[3], state[4]];
858
+ lastCol = genColumn;
859
+ if (hasMoreVlq(reader, semi)) {
860
+ sourcesIndex = decodeInteger(reader, sourcesIndex);
861
+ sourceLine = decodeInteger(reader, sourceLine);
862
+ sourceColumn = decodeInteger(reader, sourceColumn);
863
+ if (hasMoreVlq(reader, semi)) {
864
+ namesIndex = decodeInteger(reader, namesIndex);
865
+ seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
763
866
  } else {
764
- seg = [col, state[1], state[2], state[3]];
867
+ seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
765
868
  }
766
869
  } else {
767
- seg = [col];
870
+ seg = [genColumn];
768
871
  }
769
872
  line.push(seg);
873
+ reader.pos++;
770
874
  }
771
875
  if (!sorted)
772
876
  sort(line);
773
877
  decoded.push(line);
774
- index = semi + 1;
775
- } while (index <= mappings.length);
878
+ reader.pos = semi + 1;
879
+ } while (reader.pos <= length);
776
880
  return decoded;
777
881
  }
778
- function indexOf(mappings, index) {
779
- const idx = mappings.indexOf(";", index);
780
- return idx === -1 ? mappings.length : idx;
781
- }
782
- function decodeInteger(mappings, pos, state, j) {
783
- let value = 0;
784
- let shift = 0;
785
- let integer = 0;
786
- do {
787
- const c = mappings.charCodeAt(pos++);
788
- integer = charToInt[c];
789
- value |= (integer & 31) << shift;
790
- shift += 5;
791
- } while (integer & 32);
792
- const shouldNegate = value & 1;
793
- value >>>= 1;
794
- if (shouldNegate) {
795
- value = -2147483648 | -value;
796
- }
797
- state[j] += value;
798
- return pos;
799
- }
800
- function hasMoreVlq(mappings, i, length) {
801
- if (i >= length)
802
- return false;
803
- return mappings.charCodeAt(i) !== comma;
804
- }
805
882
  function sort(line) {
806
883
  line.sort(sortComparator$1);
807
884
  }
@@ -809,74 +886,38 @@ import.meta.hot.accept(({ render }) => {
809
886
  return a[0] - b[0];
810
887
  }
811
888
  function encode(decoded) {
812
- const state = new Int32Array(5);
813
- const bufLength = 1024 * 16;
814
- const subLength = bufLength - 36;
815
- const buf = new Uint8Array(bufLength);
816
- const sub = buf.subarray(0, subLength);
817
- let pos = 0;
818
- let out = "";
889
+ const writer = new StringWriter();
890
+ let sourcesIndex = 0;
891
+ let sourceLine = 0;
892
+ let sourceColumn = 0;
893
+ let namesIndex = 0;
819
894
  for (let i = 0; i < decoded.length; i++) {
820
895
  const line = decoded[i];
821
- if (i > 0) {
822
- if (pos === bufLength) {
823
- out += td.decode(buf);
824
- pos = 0;
825
- }
826
- buf[pos++] = semicolon;
827
- }
896
+ if (i > 0)
897
+ writer.write(semicolon);
828
898
  if (line.length === 0)
829
899
  continue;
830
- state[0] = 0;
900
+ let genColumn = 0;
831
901
  for (let j = 0; j < line.length; j++) {
832
902
  const segment = line[j];
833
- if (pos > subLength) {
834
- out += td.decode(sub);
835
- buf.copyWithin(0, subLength, pos);
836
- pos -= subLength;
837
- }
838
903
  if (j > 0)
839
- buf[pos++] = comma;
840
- pos = encodeInteger(buf, pos, state, segment, 0);
904
+ writer.write(comma);
905
+ genColumn = encodeInteger(writer, segment[0], genColumn);
841
906
  if (segment.length === 1)
842
907
  continue;
843
- pos = encodeInteger(buf, pos, state, segment, 1);
844
- pos = encodeInteger(buf, pos, state, segment, 2);
845
- pos = encodeInteger(buf, pos, state, segment, 3);
908
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
909
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
910
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
846
911
  if (segment.length === 4)
847
912
  continue;
848
- pos = encodeInteger(buf, pos, state, segment, 4);
913
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
849
914
  }
850
915
  }
851
- return out + td.decode(buf.subarray(0, pos));
852
- }
853
- function encodeInteger(buf, pos, state, segment, j) {
854
- const next = segment[j];
855
- let num = next - state[j];
856
- state[j] = next;
857
- num = num < 0 ? -num << 1 | 1 : num << 1;
858
- do {
859
- let clamped = num & 31;
860
- num >>>= 5;
861
- if (num > 0)
862
- clamped |= 32;
863
- buf[pos++] = intToChar[clamped];
864
- } while (num > 0);
865
- return pos;
916
+ return writer.flush();
866
917
  }
867
918
  var schemeRegex = /^[\w+.-]+:\/\//;
868
919
  var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
869
920
  var fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
870
- var UrlType;
871
- (function(UrlType2) {
872
- UrlType2[UrlType2["Empty"] = 1] = "Empty";
873
- UrlType2[UrlType2["Hash"] = 2] = "Hash";
874
- UrlType2[UrlType2["Query"] = 3] = "Query";
875
- UrlType2[UrlType2["RelativePath"] = 4] = "RelativePath";
876
- UrlType2[UrlType2["AbsolutePath"] = 5] = "AbsolutePath";
877
- UrlType2[UrlType2["SchemeRelative"] = 6] = "SchemeRelative";
878
- UrlType2[UrlType2["Absolute"] = 7] = "Absolute";
879
- })(UrlType || (UrlType = {}));
880
921
  function isAbsoluteUrl(input) {
881
922
  return schemeRegex.test(input);
882
923
  }
@@ -901,7 +942,7 @@ import.meta.hot.accept(({ render }) => {
901
942
  const path5 = match2[2];
902
943
  return makeUrl("file:", "", match2[1] || "", "", isAbsolutePath(path5) ? path5 : "/" + path5, match2[3] || "", match2[4] || "");
903
944
  }
904
- function makeUrl(scheme, user, host, port, path5, query, hash) {
945
+ function makeUrl(scheme, user, host, port, path5, query, hash2) {
905
946
  return {
906
947
  scheme,
907
948
  user,
@@ -909,22 +950,22 @@ import.meta.hot.accept(({ render }) => {
909
950
  port,
910
951
  path: path5,
911
952
  query,
912
- hash,
913
- type: UrlType.Absolute
953
+ hash: hash2,
954
+ type: 7
914
955
  };
915
956
  }
916
957
  function parseUrl(input) {
917
958
  if (isSchemeRelativeUrl(input)) {
918
959
  const url2 = parseAbsoluteUrl("http:" + input);
919
960
  url2.scheme = "";
920
- url2.type = UrlType.SchemeRelative;
961
+ url2.type = 6;
921
962
  return url2;
922
963
  }
923
964
  if (isAbsolutePath(input)) {
924
965
  const url2 = parseAbsoluteUrl("http://foo.com" + input);
925
966
  url2.scheme = "";
926
967
  url2.host = "";
927
- url2.type = UrlType.AbsolutePath;
968
+ url2.type = 5;
928
969
  return url2;
929
970
  }
930
971
  if (isFileUrl(input))
@@ -934,7 +975,7 @@ import.meta.hot.accept(({ render }) => {
934
975
  const url = parseAbsoluteUrl("http://foo.com/" + input);
935
976
  url.scheme = "";
936
977
  url.host = "";
937
- url.type = input ? input.startsWith("?") ? UrlType.Query : input.startsWith("#") ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty;
978
+ url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
938
979
  return url;
939
980
  }
940
981
  function stripPathFilename(path5) {
@@ -952,7 +993,7 @@ import.meta.hot.accept(({ render }) => {
952
993
  }
953
994
  }
954
995
  function normalizePath(url, type) {
955
- const rel = type <= UrlType.RelativePath;
996
+ const rel = type <= 4;
956
997
  const pieces = url.path.split("/");
957
998
  let pointer = 1;
958
999
  let positive = 0;
@@ -993,26 +1034,26 @@ import.meta.hot.accept(({ render }) => {
993
1034
  return "";
994
1035
  const url = parseUrl(input);
995
1036
  let inputType = url.type;
996
- if (base && inputType !== UrlType.Absolute) {
1037
+ if (base && inputType !== 7) {
997
1038
  const baseUrl = parseUrl(base);
998
1039
  const baseType = baseUrl.type;
999
1040
  switch (inputType) {
1000
- case UrlType.Empty:
1041
+ case 1:
1001
1042
  url.hash = baseUrl.hash;
1002
1043
  // fall through
1003
- case UrlType.Hash:
1044
+ case 2:
1004
1045
  url.query = baseUrl.query;
1005
1046
  // fall through
1006
- case UrlType.Query:
1007
- case UrlType.RelativePath:
1047
+ case 3:
1048
+ case 4:
1008
1049
  mergePaths(url, baseUrl);
1009
1050
  // fall through
1010
- case UrlType.AbsolutePath:
1051
+ case 5:
1011
1052
  url.user = baseUrl.user;
1012
1053
  url.host = baseUrl.host;
1013
1054
  url.port = baseUrl.port;
1014
1055
  // fall through
1015
- case UrlType.SchemeRelative:
1056
+ case 6:
1016
1057
  url.scheme = baseUrl.scheme;
1017
1058
  }
1018
1059
  if (baseType > inputType)
@@ -1023,10 +1064,10 @@ import.meta.hot.accept(({ render }) => {
1023
1064
  switch (inputType) {
1024
1065
  // This is impossible, because of the empty checks at the start of the function.
1025
1066
  // case UrlType.Empty:
1026
- case UrlType.Hash:
1027
- case UrlType.Query:
1067
+ case 2:
1068
+ case 3:
1028
1069
  return queryHash;
1029
- case UrlType.RelativePath: {
1070
+ case 4: {
1030
1071
  const path5 = url.path.slice(1);
1031
1072
  if (!path5)
1032
1073
  return queryHash || ".";
@@ -1035,7 +1076,7 @@ import.meta.hot.accept(({ render }) => {
1035
1076
  }
1036
1077
  return path5 + queryHash;
1037
1078
  }
1038
- case UrlType.AbsolutePath:
1079
+ case 5:
1039
1080
  return url.path + queryHash;
1040
1081
  default:
1041
1082
  return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
@@ -1094,8 +1135,6 @@ import.meta.hot.accept(({ render }) => {
1094
1135
  lastIndex: -1
1095
1136
  };
1096
1137
  }
1097
- var decodedMappings;
1098
- var eachMapping;
1099
1138
  var TraceMap = class {
1100
1139
  constructor(map, mapUrl) {
1101
1140
  const isString = typeof map === "string";
@@ -1109,6 +1148,7 @@ import.meta.hot.accept(({ render }) => {
1109
1148
  this.sourceRoot = sourceRoot;
1110
1149
  this.sources = sources;
1111
1150
  this.sourcesContent = sourcesContent;
1151
+ this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
1112
1152
  const from = resolve(sourceRoot || "", stripFilename(mapUrl));
1113
1153
  this.resolvedSources = sources.map((s) => resolve(s || "", from));
1114
1154
  const { mappings } = parsed;
@@ -1124,71 +1164,70 @@ import.meta.hot.accept(({ render }) => {
1124
1164
  this._bySourceMemos = void 0;
1125
1165
  }
1126
1166
  };
1127
- (() => {
1128
- decodedMappings = (map) => {
1129
- return map._decoded || (map._decoded = decode(map._encoded));
1130
- };
1131
- eachMapping = (map, cb) => {
1132
- const decoded = decodedMappings(map);
1133
- const { names, resolvedSources } = map;
1134
- for (let i = 0; i < decoded.length; i++) {
1135
- const line = decoded[i];
1136
- for (let j = 0; j < line.length; j++) {
1137
- const seg = line[j];
1138
- const generatedLine = i + 1;
1139
- const generatedColumn = seg[0];
1140
- let source = null;
1141
- let originalLine = null;
1142
- let originalColumn = null;
1143
- let name = null;
1144
- if (seg.length !== 1) {
1145
- source = resolvedSources[seg[1]];
1146
- originalLine = seg[2] + 1;
1147
- originalColumn = seg[3];
1148
- }
1149
- if (seg.length === 5)
1150
- name = names[seg[4]];
1151
- cb({
1152
- generatedLine,
1153
- generatedColumn,
1154
- source,
1155
- originalLine,
1156
- originalColumn,
1157
- name
1158
- });
1159
- }
1167
+ function cast$2(map) {
1168
+ return map;
1169
+ }
1170
+ function decodedMappings(map) {
1171
+ var _a;
1172
+ return (_a = cast$2(map))._decoded || (_a._decoded = decode(cast$2(map)._encoded));
1173
+ }
1174
+ function eachMapping(map, cb) {
1175
+ const decoded = decodedMappings(map);
1176
+ const { names, resolvedSources } = map;
1177
+ for (let i = 0; i < decoded.length; i++) {
1178
+ const line = decoded[i];
1179
+ for (let j = 0; j < line.length; j++) {
1180
+ const seg = line[j];
1181
+ const generatedLine = i + 1;
1182
+ const generatedColumn = seg[0];
1183
+ let source = null;
1184
+ let originalLine = null;
1185
+ let originalColumn = null;
1186
+ let name = null;
1187
+ if (seg.length !== 1) {
1188
+ source = resolvedSources[seg[1]];
1189
+ originalLine = seg[2] + 1;
1190
+ originalColumn = seg[3];
1191
+ }
1192
+ if (seg.length === 5)
1193
+ name = names[seg[4]];
1194
+ cb({
1195
+ generatedLine,
1196
+ generatedColumn,
1197
+ source,
1198
+ originalLine,
1199
+ originalColumn,
1200
+ name
1201
+ });
1160
1202
  }
1161
- };
1162
- })();
1163
- var get;
1164
- var put;
1203
+ }
1204
+ }
1165
1205
  var SetArray = class {
1166
1206
  constructor() {
1167
1207
  this._indexes = { __proto__: null };
1168
1208
  this.array = [];
1169
1209
  }
1170
1210
  };
1171
- (() => {
1172
- get = (strarr, key) => strarr._indexes[key];
1173
- put = (strarr, key) => {
1174
- const index = get(strarr, key);
1175
- if (index !== void 0)
1176
- return index;
1177
- const { array, _indexes: indexes } = strarr;
1178
- return indexes[key] = array.push(key) - 1;
1179
- };
1180
- })();
1211
+ function cast$1(set) {
1212
+ return set;
1213
+ }
1214
+ function get(setarr, key) {
1215
+ return cast$1(setarr)._indexes[key];
1216
+ }
1217
+ function put(setarr, key) {
1218
+ const index = get(setarr, key);
1219
+ if (index !== void 0)
1220
+ return index;
1221
+ const { array, _indexes: indexes } = cast$1(setarr);
1222
+ const length = array.push(key);
1223
+ return indexes[key] = length - 1;
1224
+ }
1181
1225
  var COLUMN = 0;
1182
1226
  var SOURCES_INDEX = 1;
1183
1227
  var SOURCE_LINE = 2;
1184
1228
  var SOURCE_COLUMN = 3;
1185
1229
  var NAMES_INDEX = 4;
1186
1230
  var NO_NAME = -1;
1187
- var addMapping;
1188
- var toDecodedMap;
1189
- var toEncodedMap;
1190
- var fromMap;
1191
- var addSegmentInternal;
1192
1231
  var GenMapping = class {
1193
1232
  constructor({ file, sourceRoot } = {}) {
1194
1233
  this._names = new SetArray();
@@ -1197,57 +1236,62 @@ import.meta.hot.accept(({ render }) => {
1197
1236
  this._mappings = [];
1198
1237
  this.file = file;
1199
1238
  this.sourceRoot = sourceRoot;
1239
+ this._ignoreList = new SetArray();
1200
1240
  }
1201
1241
  };
1202
- (() => {
1203
- addMapping = (map, mapping2) => {
1204
- return addMappingInternal(false, map, mapping2);
1205
- };
1206
- toDecodedMap = (map) => {
1207
- const { file, sourceRoot, _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = map;
1208
- removeEmptyFinalLines(mappings);
1209
- return {
1210
- version: 3,
1211
- file: file || void 0,
1212
- names: names.array,
1213
- sourceRoot: sourceRoot || void 0,
1214
- sources: sources.array,
1215
- sourcesContent,
1216
- mappings
1217
- };
1218
- };
1219
- toEncodedMap = (map) => {
1220
- const decoded = toDecodedMap(map);
1221
- return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });
1222
- };
1223
- fromMap = (input) => {
1224
- const map = new TraceMap(input);
1225
- const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
1226
- putAll(gen._names, map.names);
1227
- putAll(gen._sources, map.sources);
1228
- gen._sourcesContent = map.sourcesContent || map.sources.map(() => null);
1229
- gen._mappings = decodedMappings(map);
1230
- return gen;
1242
+ function cast(map) {
1243
+ return map;
1244
+ }
1245
+ function addMapping(map, mapping2) {
1246
+ return addMappingInternal(false, map, mapping2);
1247
+ }
1248
+ function toDecodedMap(map) {
1249
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList2 } = cast(map);
1250
+ removeEmptyFinalLines(mappings);
1251
+ return {
1252
+ version: 3,
1253
+ file: map.file || void 0,
1254
+ names: names.array,
1255
+ sourceRoot: map.sourceRoot || void 0,
1256
+ sources: sources.array,
1257
+ sourcesContent,
1258
+ mappings,
1259
+ ignoreList: ignoreList2.array
1231
1260
  };
1232
- addSegmentInternal = (skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
1233
- const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = map;
1234
- const line = getLine(mappings, genLine);
1235
- const index = getColumnIndex(line, genColumn);
1236
- if (!source) {
1237
- if (skipable && skipSourceless(line, index))
1238
- return;
1239
- return insert(line, index, [genColumn]);
1240
- }
1241
- const sourcesIndex = put(sources, source);
1242
- const namesIndex = name ? put(names, name) : NO_NAME;
1243
- if (sourcesIndex === sourcesContent.length)
1244
- sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
1245
- if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
1261
+ }
1262
+ function toEncodedMap(map) {
1263
+ const decoded = toDecodedMap(map);
1264
+ return Object.assign(Object.assign({}, decoded), { mappings: encode(decoded.mappings) });
1265
+ }
1266
+ function fromMap(input) {
1267
+ const map = new TraceMap(input);
1268
+ const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
1269
+ putAll(cast(gen)._names, map.names);
1270
+ putAll(cast(gen)._sources, map.sources);
1271
+ cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
1272
+ cast(gen)._mappings = decodedMappings(map);
1273
+ if (map.ignoreList)
1274
+ putAll(cast(gen)._ignoreList, map.ignoreList);
1275
+ return gen;
1276
+ }
1277
+ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
1278
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast(map);
1279
+ const line = getLine(mappings, genLine);
1280
+ const index = getColumnIndex(line, genColumn);
1281
+ if (!source) {
1282
+ if (skipable && skipSourceless(line, index))
1246
1283
  return;
1247
- }
1248
- return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
1249
- };
1250
- })();
1284
+ return insert(line, index, [genColumn]);
1285
+ }
1286
+ const sourcesIndex = put(sources, source);
1287
+ const namesIndex = name ? put(names, name) : NO_NAME;
1288
+ if (sourcesIndex === sourcesContent.length)
1289
+ sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
1290
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
1291
+ return;
1292
+ }
1293
+ return insert(line, index, name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
1294
+ }
1251
1295
  function getLine(mappings, index) {
1252
1296
  for (let i = mappings.length; i <= index; i++) {
1253
1297
  mappings[i] = [];
@@ -1279,9 +1323,9 @@ import.meta.hot.accept(({ render }) => {
1279
1323
  if (len < length)
1280
1324
  mappings.length = len;
1281
1325
  }
1282
- function putAll(strarr, array) {
1326
+ function putAll(setarr, array) {
1283
1327
  for (let i = 0; i < array.length; i++)
1284
- put(strarr, array[i]);
1328
+ put(setarr, array[i]);
1285
1329
  }
1286
1330
  function skipSourceless(line, index) {
1287
1331
  if (index === 0)
@@ -1302,8 +1346,7 @@ import.meta.hot.accept(({ render }) => {
1302
1346
  if (!source) {
1303
1347
  return addSegmentInternal(skipable, map, generated.line - 1, generated.column, null, null, null, null, null);
1304
1348
  }
1305
- const s = source;
1306
- return addSegmentInternal(skipable, map, generated.line - 1, generated.column, s, original.line - 1, original.column, name, content);
1349
+ return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
1307
1350
  }
1308
1351
  function getDefaultExportFromCjs(x) {
1309
1352
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -1448,12 +1491,12 @@ import.meta.hot.accept(({ render }) => {
1448
1491
  createDebug.skips = [];
1449
1492
  createDebug.formatters = {};
1450
1493
  function selectColor(namespace) {
1451
- let hash = 0;
1494
+ let hash2 = 0;
1452
1495
  for (let i = 0; i < namespace.length; i++) {
1453
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
1454
- hash |= 0;
1496
+ hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i);
1497
+ hash2 |= 0;
1455
1498
  }
1456
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
1499
+ return createDebug.colors[Math.abs(hash2) % createDebug.colors.length];
1457
1500
  }
1458
1501
  createDebug.selectColor = selectColor;
1459
1502
  function createDebug(namespace) {
@@ -1695,10 +1738,11 @@ import.meta.hot.accept(({ render }) => {
1695
1738
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
1696
1739
  return false;
1697
1740
  }
1741
+ let m;
1698
1742
  return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
1699
1743
  typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
1700
1744
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
1701
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1745
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
1702
1746
  typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
1703
1747
  }
1704
1748
  function formatArgs(args) {
@@ -1907,7 +1951,7 @@ import.meta.hot.accept(({ render }) => {
1907
1951
  return (/* @__PURE__ */ new Date()).toISOString() + " ";
1908
1952
  }
1909
1953
  function log(...args) {
1910
- return process.stderr.write(util.format(...args) + "\n");
1954
+ return process.stderr.write(util.formatWithOptions(exports3.inspectOpts, ...args) + "\n");
1911
1955
  }
1912
1956
  function save(namespaces) {
1913
1957
  if (namespaces) {
@@ -1948,7 +1992,7 @@ import.meta.hot.accept(({ render }) => {
1948
1992
  var _debug = /* @__PURE__ */ getDefaultExportFromCjs(srcExports);
1949
1993
  var debug = _debug("vite:hmr");
1950
1994
  var directRequestRE = /(?:\?|&)direct\b/;
1951
- async function handleHotUpdate({ file, modules, read }, options) {
1995
+ async function handleHotUpdate({ file, modules, read }, options, customElement) {
1952
1996
  const prevDescriptor = getDescriptor(file, options, false, true);
1953
1997
  if (!prevDescriptor) {
1954
1998
  return;
@@ -1959,6 +2003,7 @@ import.meta.hot.accept(({ render }) => {
1959
2003
  const affectedModules = /* @__PURE__ */ new Set();
1960
2004
  const mainModule = getMainModule(modules);
1961
2005
  const templateModule = modules.find((m) => /type=template/.test(m.url));
2006
+ resolveScript(descriptor, options, false, customElement);
1962
2007
  const scriptChanged = hasScriptChanged(prevDescriptor, descriptor);
1963
2008
  if (scriptChanged) {
1964
2009
  affectedModules.add(getScriptModule(modules) || mainModule);
@@ -2069,11 +2114,71 @@ import.meta.hot.accept(({ render }) => {
2069
2114
  function isOnlyTemplateChanged(prev, next) {
2070
2115
  return !hasScriptChanged(prev, next) && prev.styles.length === next.styles.length && prev.styles.every((s, i) => isEqualBlock(s, next.styles[i])) && prev.customBlocks.length === next.customBlocks.length && prev.customBlocks.every((s, i) => isEqualBlock(s, next.customBlocks[i]));
2071
2116
  }
2117
+ function deepEqual(obj1, obj2, excludeProps = [], deepParentsOfObj1 = []) {
2118
+ if (typeof obj1 !== typeof obj2) {
2119
+ return false;
2120
+ }
2121
+ if (obj1 == null || obj2 == null || typeof obj1 !== "object" || deepParentsOfObj1.includes(obj1)) {
2122
+ return obj1 === obj2;
2123
+ }
2124
+ const keys1 = Object.keys(obj1);
2125
+ const keys2 = Object.keys(obj2);
2126
+ if (keys1.length !== keys2.length) {
2127
+ return false;
2128
+ }
2129
+ for (const key of keys1) {
2130
+ if (excludeProps.includes(key)) {
2131
+ continue;
2132
+ }
2133
+ if (!deepEqual(obj1[key], obj2[key], excludeProps, [
2134
+ ...deepParentsOfObj1,
2135
+ obj1
2136
+ ])) {
2137
+ return false;
2138
+ }
2139
+ }
2140
+ return true;
2141
+ }
2142
+ function isEqualAst(prev, next) {
2143
+ if (typeof prev === "undefined" || typeof next === "undefined") {
2144
+ return prev === next;
2145
+ }
2146
+ if (prev.length !== next.length) {
2147
+ return false;
2148
+ }
2149
+ for (let i = 0; i < prev.length; i++) {
2150
+ const prevNode = prev[i];
2151
+ const nextNode = next[i];
2152
+ if (
2153
+ // deep equal, but ignore start/end/loc/range/leadingComments/trailingComments/innerComments
2154
+ !deepEqual(prevNode, nextNode, [
2155
+ "start",
2156
+ "end",
2157
+ "loc",
2158
+ "range",
2159
+ "leadingComments",
2160
+ "trailingComments",
2161
+ "innerComments",
2162
+ // https://github.com/vuejs/core/issues/11923
2163
+ // avoid comparing the following properties of typeParameters
2164
+ // as it may be imported from 3rd lib and complex to compare
2165
+ "_ownerScope",
2166
+ "_resolvedReference",
2167
+ "_resolvedElements"
2168
+ ])
2169
+ ) {
2170
+ return false;
2171
+ }
2172
+ }
2173
+ return true;
2174
+ }
2072
2175
  function hasScriptChanged(prev, next) {
2073
- if (!isEqualBlock(prev.script, next.script)) {
2176
+ const prevScript = getResolvedScript(prev, false);
2177
+ const nextScript = getResolvedScript(next, false);
2178
+ if (!isEqualBlock(prev.script, next.script) && !isEqualAst(prevScript?.scriptAst, nextScript?.scriptAst)) {
2074
2179
  return true;
2075
2180
  }
2076
- if (!isEqualBlock(prev.scriptSetup, next.scriptSetup)) {
2181
+ if (!isEqualBlock(prev.scriptSetup, next.scriptSetup) && !isEqualAst(prevScript?.scriptSetupAst, nextScript?.scriptSetupAst)) {
2077
2182
  return true;
2078
2183
  }
2079
2184
  const prevResolvedScript = getResolvedScript(prev, false);
@@ -2126,7 +2231,7 @@ export default (sfc, props) => {
2126
2231
  // for vue files, create descriptor from fs read to be consistent with
2127
2232
  // logic in handleHotUpdate()
2128
2233
  // for non vue files, e.g. md files in vitepress, we assume
2129
- // `hmrContext.read` is overwriten so handleHotUpdate() is dealing with
2234
+ // `hmrContext.read` is overwritten so handleHotUpdate() is dealing with
2130
2235
  // post-transform code, so we populate the descriptor with post-transform
2131
2236
  // code here as well.
2132
2237
  filename.endsWith(".vue") ? void 0 : code
@@ -2147,7 +2252,7 @@ export default (sfc, props) => {
2147
2252
  ssr,
2148
2253
  customElement
2149
2254
  );
2150
- const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, !devServer);
2255
+ const hasTemplateImport = descriptor.template && !isUseInlineTemplate(descriptor, options);
2151
2256
  let templateCode = "";
2152
2257
  let templateMap = void 0;
2153
2258
  if (hasTemplateImport) {
@@ -2195,8 +2300,15 @@ export default (sfc, props) => {
2195
2300
  output.push(
2196
2301
  `typeof __VUE_HMR_RUNTIME__ !== 'undefined' && __VUE_HMR_RUNTIME__.createRecord(_sfc_main.__hmrId, _sfc_main)`
2197
2302
  );
2303
+ output.push(
2304
+ `import.meta.hot.on('file-changed', ({ file }) => {`,
2305
+ ` __VUE_HMR_RUNTIME__.CHANGED_FILE = file`,
2306
+ `})`
2307
+ );
2198
2308
  if (prevDescriptor && isOnlyTemplateChanged(prevDescriptor, descriptor)) {
2199
- output.push(`export const _rerender_only = true`);
2309
+ output.push(
2310
+ `export const _rerender_only = __VUE_HMR_RUNTIME__.CHANGED_FILE === ${JSON.stringify(vite.normalizePath(filename))}`
2311
+ );
2200
2312
  }
2201
2313
  output.push(
2202
2314
  `import.meta.hot.accept(mod => {`,
@@ -2272,8 +2384,11 @@ export default (sfc, props) => {
2272
2384
  resolvedCode,
2273
2385
  filename,
2274
2386
  {
2275
- loader: "ts",
2276
2387
  target: "esnext",
2388
+ // #430 support decorators in .vue file
2389
+ // target can be overridden by esbuild config target
2390
+ ...options.devServer?.config.esbuild,
2391
+ loader: "ts",
2277
2392
  sourcemap: options.sourceMap
2278
2393
  },
2279
2394
  resolvedMap
@@ -2529,28 +2644,25 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2529
2644
  };
2530
2645
  }
2531
2646
  function vuePlugin2(rawOptions = {}) {
2647
+ clearScriptCache();
2532
2648
  const options = vue.shallowRef({
2533
2649
  isProduction: process.env.NODE_ENV === "production",
2534
2650
  compiler: null,
2535
2651
  // to be set in buildStart
2536
2652
  include: /\.vue$/,
2537
2653
  customElement: /\.ce\.vue$/,
2538
- reactivityTransform: false,
2539
2654
  ...rawOptions,
2540
2655
  root: process.cwd(),
2541
2656
  sourceMap: true,
2542
- cssDevSourcemap: false,
2543
- devToolsEnabled: process.env.NODE_ENV !== "production"
2657
+ cssDevSourcemap: false
2544
2658
  });
2545
2659
  const filter3 = vue.computed(
2546
2660
  () => vite.createFilter(options.value.include, options.value.exclude)
2547
2661
  );
2548
- const customElementFilter = vue.computed(
2549
- () => typeof options.value.customElement === "boolean" ? () => options.value.customElement : vite.createFilter(options.value.customElement)
2550
- );
2551
- const refTransformFilter = vue.computed(
2552
- () => options.value.reactivityTransform === false ? () => false : options.value.reactivityTransform === true ? vite.createFilter(/\.(j|t)sx?$/, /node_modules/) : vite.createFilter(options.value.reactivityTransform)
2553
- );
2662
+ const customElementFilter = vue.computed(() => {
2663
+ const customElement = options.value.features?.customElement || options.value.customElement;
2664
+ return typeof customElement === "boolean" ? () => customElement : vite.createFilter(customElement);
2665
+ });
2554
2666
  return {
2555
2667
  name: "vite:vue",
2556
2668
  api: {
@@ -2563,6 +2675,11 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2563
2675
  version: version2
2564
2676
  },
2565
2677
  handleHotUpdate(ctx) {
2678
+ ctx.server.ws.send({
2679
+ type: "custom",
2680
+ event: "file-changed",
2681
+ data: { file: vite.normalizePath(ctx.file) }
2682
+ });
2566
2683
  if (options.value.compiler.invalidateTypeCache) {
2567
2684
  options.value.compiler.invalidateTypeCache(ctx.file);
2568
2685
  }
@@ -2570,7 +2687,11 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2570
2687
  return handleTypeDepChange(typeDepToSFCMap.get(ctx.file), ctx);
2571
2688
  }
2572
2689
  if (filter3.value(ctx.file)) {
2573
- return handleHotUpdate(ctx, options.value);
2690
+ return handleHotUpdate(
2691
+ ctx,
2692
+ options.value,
2693
+ customElementFilter.value(ctx.file)
2694
+ );
2574
2695
  }
2575
2696
  },
2576
2697
  config(config) {
@@ -2579,9 +2700,9 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2579
2700
  dedupe: config.build?.ssr ? [] : ["vue"]
2580
2701
  },
2581
2702
  define: {
2582
- __VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
2583
- __VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
2584
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
2703
+ __VUE_OPTIONS_API__: !!((options.value.features?.optionsAPI ?? true) || config.define?.__VUE_OPTIONS_API__),
2704
+ __VUE_PROD_DEVTOOLS__: !!(options.value.features?.prodDevtools || config.define?.__VUE_PROD_DEVTOOLS__),
2705
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: !!(options.value.features?.prodHydrationMismatchDetails || config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__)
2585
2706
  },
2586
2707
  ssr: {
2587
2708
  // @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
@@ -2596,7 +2717,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2596
2717
  sourceMap: config.command === "build" ? !!config.build.sourcemap : true,
2597
2718
  cssDevSourcemap: config.css?.devSourcemap ?? false,
2598
2719
  isProduction: config.isProduction,
2599
- devToolsEnabled: !!config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction
2720
+ devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
2600
2721
  };
2601
2722
  },
2602
2723
  configureServer(server) {
@@ -2631,7 +2752,12 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2631
2752
  const descriptor = getDescriptor(filename, options.value);
2632
2753
  let block;
2633
2754
  if (query.type === "script") {
2634
- block = getResolvedScript(descriptor, ssr);
2755
+ block = resolveScript(
2756
+ descriptor,
2757
+ options.value,
2758
+ ssr,
2759
+ customElementFilter.value(filename)
2760
+ );
2635
2761
  } else if (query.type === "template") {
2636
2762
  block = descriptor.template;
2637
2763
  } else if (query.type === "style") {
@@ -2654,13 +2780,6 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2654
2780
  return;
2655
2781
  }
2656
2782
  if (!filter3.value(filename) && !query.vue) {
2657
- if (!query.vue && refTransformFilter.value(filename) && options.value.compiler.shouldTransformRef(code)) {
2658
- const result = options.value.compiler.transformRef(code, {
2659
- filename,
2660
- sourceMap: true
2661
- });
2662
- return result;
2663
- }
2664
2783
  return;
2665
2784
  }
2666
2785
  if (!query.vue) {
@@ -2703,14 +2822,6 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
2703
2822
  }
2704
2823
  });
2705
2824
 
2706
- // internal/plugin-vue3/index.js
2707
- var require_plugin_vue3 = __commonJS({
2708
- "internal/plugin-vue3/index.js"(exports2, module2) {
2709
- var vue = require_dist();
2710
- module2.exports = vue;
2711
- }
2712
- });
2713
-
2714
2825
  // node_modules/balanced-match/index.js
2715
2826
  var require_balanced_match = __commonJS({
2716
2827
  "node_modules/balanced-match/index.js"(exports2, module2) {
@@ -4778,7 +4889,7 @@ module.exports = __toCommonJS(vite_config_exports);
4778
4889
  var import_apimock_express = require("@forsakringskassan/apimock-express");
4779
4890
  var import_deepmerge = __toESM(require_cjs());
4780
4891
  var import_picocolors = __toESM(require_picocolors());
4781
- var import_plugin_vue3 = __toESM(require_plugin_vue3());
4892
+ var import_plugin_vue = __toESM(require_dist());
4782
4893
 
4783
4894
  // src/plugins/babel-plugin.ts
4784
4895
  var babel = __toESM(require("@babel/core"));
@@ -11406,7 +11517,7 @@ function vuePlugin(config) {
11406
11517
  case 2:
11407
11518
  throw new Error("Vue 2 is no longer supported");
11408
11519
  case 3:
11409
- return (0, import_plugin_vue3.default)(resolvedConfig);
11520
+ return (0, import_plugin_vue.default)(resolvedConfig);
11410
11521
  }
11411
11522
  }
11412
11523
  var vueMajor = detectVueMajor();