vite 5.4.0-beta.1 → 5.4.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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -10781,17 +10781,34 @@ const glob$1 = Object.assign(glob_, {
10781
10781
  });
10782
10782
  glob$1.glob = glob$1;
10783
10783
 
10784
- const comma$1 = ','.charCodeAt(0);
10785
- const semicolon$1 = ';'.charCodeAt(0);
10786
- const chars$2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
10787
- const intToChar$1 = new Uint8Array(64); // 64 possible chars.
10788
- const charToInt$1 = new Uint8Array(128); // z is 122 in ASCII
10789
- for (let i = 0; i < chars$2.length; i++) {
10790
- const c = chars$2.charCodeAt(i);
10791
- intToChar$1[i] = c;
10792
- charToInt$1[c] = i;
10793
- }
10794
- function encodeInteger$1(builder, num, relative) {
10784
+ const comma = ','.charCodeAt(0);
10785
+ const semicolon = ';'.charCodeAt(0);
10786
+ const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
10787
+ const intToChar = new Uint8Array(64); // 64 possible chars.
10788
+ const charToInt = new Uint8Array(128); // z is 122 in ASCII
10789
+ for (let i = 0; i < chars$1.length; i++) {
10790
+ const c = chars$1.charCodeAt(i);
10791
+ intToChar[i] = c;
10792
+ charToInt[c] = i;
10793
+ }
10794
+ function decodeInteger(reader, relative) {
10795
+ let value = 0;
10796
+ let shift = 0;
10797
+ let integer = 0;
10798
+ do {
10799
+ const c = reader.next();
10800
+ integer = charToInt[c];
10801
+ value |= (integer & 31) << shift;
10802
+ shift += 5;
10803
+ } while (integer & 32);
10804
+ const shouldNegate = value & 1;
10805
+ value >>>= 1;
10806
+ if (shouldNegate) {
10807
+ value = -0x80000000 | -value;
10808
+ }
10809
+ return relative + value;
10810
+ }
10811
+ function encodeInteger(builder, num, relative) {
10795
10812
  let delta = num - relative;
10796
10813
  delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
10797
10814
  do {
@@ -10799,14 +10816,19 @@ function encodeInteger$1(builder, num, relative) {
10799
10816
  delta >>>= 5;
10800
10817
  if (delta > 0)
10801
10818
  clamped |= 0b100000;
10802
- builder.write(intToChar$1[clamped]);
10819
+ builder.write(intToChar[clamped]);
10803
10820
  } while (delta > 0);
10804
10821
  return num;
10805
10822
  }
10823
+ function hasMoreVlq(reader, max) {
10824
+ if (reader.pos >= max)
10825
+ return false;
10826
+ return reader.peek() !== comma;
10827
+ }
10806
10828
 
10807
10829
  const bufLength = 1024 * 16;
10808
10830
  // Provide a fallback for older environments.
10809
- const td$1 = typeof TextDecoder !== 'undefined'
10831
+ const td = typeof TextDecoder !== 'undefined'
10810
10832
  ? /* #__PURE__ */ new TextDecoder()
10811
10833
  : typeof Buffer !== 'undefined'
10812
10834
  ? {
@@ -10834,16 +10856,86 @@ class StringWriter {
10834
10856
  const { buffer } = this;
10835
10857
  buffer[this.pos++] = v;
10836
10858
  if (this.pos === bufLength) {
10837
- this.out += td$1.decode(buffer);
10859
+ this.out += td.decode(buffer);
10838
10860
  this.pos = 0;
10839
10861
  }
10840
10862
  }
10841
10863
  flush() {
10842
10864
  const { buffer, out, pos } = this;
10843
- return pos > 0 ? out + td$1.decode(buffer.subarray(0, pos)) : out;
10865
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
10866
+ }
10867
+ }
10868
+ class StringReader {
10869
+ constructor(buffer) {
10870
+ this.pos = 0;
10871
+ this.buffer = buffer;
10844
10872
  }
10873
+ next() {
10874
+ return this.buffer.charCodeAt(this.pos++);
10875
+ }
10876
+ peek() {
10877
+ return this.buffer.charCodeAt(this.pos);
10878
+ }
10879
+ indexOf(char) {
10880
+ const { buffer, pos } = this;
10881
+ const idx = buffer.indexOf(char, pos);
10882
+ return idx === -1 ? buffer.length : idx;
10883
+ }
10884
+ }
10885
+
10886
+ function decode(mappings) {
10887
+ const { length } = mappings;
10888
+ const reader = new StringReader(mappings);
10889
+ const decoded = [];
10890
+ let genColumn = 0;
10891
+ let sourcesIndex = 0;
10892
+ let sourceLine = 0;
10893
+ let sourceColumn = 0;
10894
+ let namesIndex = 0;
10895
+ do {
10896
+ const semi = reader.indexOf(';');
10897
+ const line = [];
10898
+ let sorted = true;
10899
+ let lastCol = 0;
10900
+ genColumn = 0;
10901
+ while (reader.pos < semi) {
10902
+ let seg;
10903
+ genColumn = decodeInteger(reader, genColumn);
10904
+ if (genColumn < lastCol)
10905
+ sorted = false;
10906
+ lastCol = genColumn;
10907
+ if (hasMoreVlq(reader, semi)) {
10908
+ sourcesIndex = decodeInteger(reader, sourcesIndex);
10909
+ sourceLine = decodeInteger(reader, sourceLine);
10910
+ sourceColumn = decodeInteger(reader, sourceColumn);
10911
+ if (hasMoreVlq(reader, semi)) {
10912
+ namesIndex = decodeInteger(reader, namesIndex);
10913
+ seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
10914
+ }
10915
+ else {
10916
+ seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
10917
+ }
10918
+ }
10919
+ else {
10920
+ seg = [genColumn];
10921
+ }
10922
+ line.push(seg);
10923
+ reader.pos++;
10924
+ }
10925
+ if (!sorted)
10926
+ sort(line);
10927
+ decoded.push(line);
10928
+ reader.pos = semi + 1;
10929
+ } while (reader.pos <= length);
10930
+ return decoded;
10931
+ }
10932
+ function sort(line) {
10933
+ line.sort(sortComparator$1);
10934
+ }
10935
+ function sortComparator$1(a, b) {
10936
+ return a[0] - b[0];
10845
10937
  }
10846
- function encode$2(decoded) {
10938
+ function encode$1(decoded) {
10847
10939
  const writer = new StringWriter();
10848
10940
  let sourcesIndex = 0;
10849
10941
  let sourceLine = 0;
@@ -10852,23 +10944,23 @@ function encode$2(decoded) {
10852
10944
  for (let i = 0; i < decoded.length; i++) {
10853
10945
  const line = decoded[i];
10854
10946
  if (i > 0)
10855
- writer.write(semicolon$1);
10947
+ writer.write(semicolon);
10856
10948
  if (line.length === 0)
10857
10949
  continue;
10858
10950
  let genColumn = 0;
10859
10951
  for (let j = 0; j < line.length; j++) {
10860
10952
  const segment = line[j];
10861
10953
  if (j > 0)
10862
- writer.write(comma$1);
10863
- genColumn = encodeInteger$1(writer, segment[0], genColumn);
10954
+ writer.write(comma);
10955
+ genColumn = encodeInteger(writer, segment[0], genColumn);
10864
10956
  if (segment.length === 1)
10865
10957
  continue;
10866
- sourcesIndex = encodeInteger$1(writer, segment[1], sourcesIndex);
10867
- sourceLine = encodeInteger$1(writer, segment[2], sourceLine);
10868
- sourceColumn = encodeInteger$1(writer, segment[3], sourceColumn);
10958
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
10959
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
10960
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
10869
10961
  if (segment.length === 4)
10870
10962
  continue;
10871
- namesIndex = encodeInteger$1(writer, segment[4], namesIndex);
10963
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
10872
10964
  }
10873
10965
  }
10874
10966
  return writer.flush();
@@ -11088,7 +11180,7 @@ let SourceMap$1 = class SourceMap {
11088
11180
  this.sources = properties.sources;
11089
11181
  this.sourcesContent = properties.sourcesContent;
11090
11182
  this.names = properties.names;
11091
- this.mappings = encode$2(properties.mappings);
11183
+ this.mappings = encode$1(properties.mappings);
11092
11184
  if (typeof properties.x_google_ignoreList !== 'undefined') {
11093
11185
  this.x_google_ignoreList = properties.x_google_ignoreList;
11094
11186
  }
@@ -14448,168 +14540,6 @@ function commonjs(options = {}) {
14448
14540
  };
14449
14541
  }
14450
14542
 
14451
- const comma = ','.charCodeAt(0);
14452
- const semicolon = ';'.charCodeAt(0);
14453
- const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
14454
- const intToChar = new Uint8Array(64); // 64 possible chars.
14455
- const charToInt = new Uint8Array(128); // z is 122 in ASCII
14456
- for (let i = 0; i < chars$1.length; i++) {
14457
- const c = chars$1.charCodeAt(i);
14458
- intToChar[i] = c;
14459
- charToInt[c] = i;
14460
- }
14461
- // Provide a fallback for older environments.
14462
- const td = typeof TextDecoder !== 'undefined'
14463
- ? /* #__PURE__ */ new TextDecoder()
14464
- : typeof Buffer !== 'undefined'
14465
- ? {
14466
- decode(buf) {
14467
- const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
14468
- return out.toString();
14469
- },
14470
- }
14471
- : {
14472
- decode(buf) {
14473
- let out = '';
14474
- for (let i = 0; i < buf.length; i++) {
14475
- out += String.fromCharCode(buf[i]);
14476
- }
14477
- return out;
14478
- },
14479
- };
14480
- function decode(mappings) {
14481
- const state = new Int32Array(5);
14482
- const decoded = [];
14483
- let index = 0;
14484
- do {
14485
- const semi = indexOf(mappings, index);
14486
- const line = [];
14487
- let sorted = true;
14488
- let lastCol = 0;
14489
- state[0] = 0;
14490
- for (let i = index; i < semi; i++) {
14491
- let seg;
14492
- i = decodeInteger(mappings, i, state, 0); // genColumn
14493
- const col = state[0];
14494
- if (col < lastCol)
14495
- sorted = false;
14496
- lastCol = col;
14497
- if (hasMoreVlq(mappings, i, semi)) {
14498
- i = decodeInteger(mappings, i, state, 1); // sourcesIndex
14499
- i = decodeInteger(mappings, i, state, 2); // sourceLine
14500
- i = decodeInteger(mappings, i, state, 3); // sourceColumn
14501
- if (hasMoreVlq(mappings, i, semi)) {
14502
- i = decodeInteger(mappings, i, state, 4); // namesIndex
14503
- seg = [col, state[1], state[2], state[3], state[4]];
14504
- }
14505
- else {
14506
- seg = [col, state[1], state[2], state[3]];
14507
- }
14508
- }
14509
- else {
14510
- seg = [col];
14511
- }
14512
- line.push(seg);
14513
- }
14514
- if (!sorted)
14515
- sort(line);
14516
- decoded.push(line);
14517
- index = semi + 1;
14518
- } while (index <= mappings.length);
14519
- return decoded;
14520
- }
14521
- function indexOf(mappings, index) {
14522
- const idx = mappings.indexOf(';', index);
14523
- return idx === -1 ? mappings.length : idx;
14524
- }
14525
- function decodeInteger(mappings, pos, state, j) {
14526
- let value = 0;
14527
- let shift = 0;
14528
- let integer = 0;
14529
- do {
14530
- const c = mappings.charCodeAt(pos++);
14531
- integer = charToInt[c];
14532
- value |= (integer & 31) << shift;
14533
- shift += 5;
14534
- } while (integer & 32);
14535
- const shouldNegate = value & 1;
14536
- value >>>= 1;
14537
- if (shouldNegate) {
14538
- value = -0x80000000 | -value;
14539
- }
14540
- state[j] += value;
14541
- return pos;
14542
- }
14543
- function hasMoreVlq(mappings, i, length) {
14544
- if (i >= length)
14545
- return false;
14546
- return mappings.charCodeAt(i) !== comma;
14547
- }
14548
- function sort(line) {
14549
- line.sort(sortComparator$1);
14550
- }
14551
- function sortComparator$1(a, b) {
14552
- return a[0] - b[0];
14553
- }
14554
- function encode$1(decoded) {
14555
- const state = new Int32Array(5);
14556
- const bufLength = 1024 * 16;
14557
- const subLength = bufLength - 36;
14558
- const buf = new Uint8Array(bufLength);
14559
- const sub = buf.subarray(0, subLength);
14560
- let pos = 0;
14561
- let out = '';
14562
- for (let i = 0; i < decoded.length; i++) {
14563
- const line = decoded[i];
14564
- if (i > 0) {
14565
- if (pos === bufLength) {
14566
- out += td.decode(buf);
14567
- pos = 0;
14568
- }
14569
- buf[pos++] = semicolon;
14570
- }
14571
- if (line.length === 0)
14572
- continue;
14573
- state[0] = 0;
14574
- for (let j = 0; j < line.length; j++) {
14575
- const segment = line[j];
14576
- // We can push up to 5 ints, each int can take at most 7 chars, and we
14577
- // may push a comma.
14578
- if (pos > subLength) {
14579
- out += td.decode(sub);
14580
- buf.copyWithin(0, subLength, pos);
14581
- pos -= subLength;
14582
- }
14583
- if (j > 0)
14584
- buf[pos++] = comma;
14585
- pos = encodeInteger(buf, pos, state, segment, 0); // genColumn
14586
- if (segment.length === 1)
14587
- continue;
14588
- pos = encodeInteger(buf, pos, state, segment, 1); // sourcesIndex
14589
- pos = encodeInteger(buf, pos, state, segment, 2); // sourceLine
14590
- pos = encodeInteger(buf, pos, state, segment, 3); // sourceColumn
14591
- if (segment.length === 4)
14592
- continue;
14593
- pos = encodeInteger(buf, pos, state, segment, 4); // namesIndex
14594
- }
14595
- }
14596
- return out + td.decode(buf.subarray(0, pos));
14597
- }
14598
- function encodeInteger(buf, pos, state, segment, j) {
14599
- const next = segment[j];
14600
- let num = next - state[j];
14601
- state[j] = next;
14602
- num = num < 0 ? (-num << 1) | 1 : num << 1;
14603
- do {
14604
- let clamped = num & 0b011111;
14605
- num >>>= 5;
14606
- if (num > 0)
14607
- clamped |= 0b100000;
14608
- buf[pos++] = intToChar[clamped];
14609
- } while (num > 0);
14610
- return pos;
14611
- }
14612
-
14613
14543
  // Matches the scheme of a URL, eg "http://"
14614
14544
  const schemeRegex = /^[\w+.-]+:\/\//;
14615
14545
  /**
@@ -27143,7 +27073,6 @@ class Collection extends NodeBase {
27143
27073
  }
27144
27074
  }
27145
27075
  }
27146
- Collection.maxFlowStringSingleLineLength = 60;
27147
27076
 
27148
27077
  /**
27149
27078
  * Stringifies a comment.
@@ -27175,6 +27104,8 @@ const FOLD_QUOTED = 'quoted';
27175
27104
  function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
27176
27105
  if (!lineWidth || lineWidth < 0)
27177
27106
  return text;
27107
+ if (lineWidth < minContentWidth)
27108
+ minContentWidth = 0;
27178
27109
  const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
27179
27110
  if (text.length <= endStep)
27180
27111
  return text;
@@ -29747,11 +29678,11 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
29747
29678
  let comment = '';
29748
29679
  let commentSep = '';
29749
29680
  let hasNewline = false;
29750
- let hasNewlineAfterProp = false;
29751
29681
  let reqSpace = false;
29752
29682
  let tab = null;
29753
29683
  let anchor = null;
29754
29684
  let tag = null;
29685
+ let newlineAfterProp = null;
29755
29686
  let comma = null;
29756
29687
  let found = null;
29757
29688
  let start = null;
@@ -29805,7 +29736,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
29805
29736
  atNewline = true;
29806
29737
  hasNewline = true;
29807
29738
  if (anchor || tag)
29808
- hasNewlineAfterProp = true;
29739
+ newlineAfterProp = token;
29809
29740
  hasSpace = true;
29810
29741
  break;
29811
29742
  case 'anchor':
@@ -29879,9 +29810,9 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
29879
29810
  spaceBefore,
29880
29811
  comment,
29881
29812
  hasNewline,
29882
- hasNewlineAfterProp,
29883
29813
  anchor,
29884
29814
  tag,
29815
+ newlineAfterProp,
29885
29816
  end,
29886
29817
  start: start ?? end
29887
29818
  };
@@ -29983,7 +29914,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
29983
29914
  }
29984
29915
  continue;
29985
29916
  }
29986
- if (keyProps.hasNewlineAfterProp || containsNewline(key)) {
29917
+ if (keyProps.newlineAfterProp || containsNewline(key)) {
29987
29918
  onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
29988
29919
  }
29989
29920
  }
@@ -30337,10 +30268,23 @@ function resolveCollection(CN, ctx, token, onError, tagName, tag) {
30337
30268
  coll.tag = tagName;
30338
30269
  return coll;
30339
30270
  }
30340
- function composeCollection(CN, ctx, token, tagToken, onError) {
30271
+ function composeCollection(CN, ctx, token, props, onError) {
30272
+ const tagToken = props.tag;
30341
30273
  const tagName = !tagToken
30342
30274
  ? null
30343
30275
  : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
30276
+ if (token.type === 'block-seq') {
30277
+ const { anchor, newlineAfterProp: nl } = props;
30278
+ const lastProp = anchor && tagToken
30279
+ ? anchor.offset > tagToken.offset
30280
+ ? anchor
30281
+ : tagToken
30282
+ : (anchor ?? tagToken);
30283
+ if (lastProp && (!nl || nl.offset < lastProp.offset)) {
30284
+ const message = 'Missing newline after block sequence props';
30285
+ onError(lastProp, 'MISSING_CHAR', message);
30286
+ }
30287
+ }
30344
30288
  const expType = token.type === 'block-map'
30345
30289
  ? 'map'
30346
30290
  : token.type === 'block-seq'
@@ -30354,8 +30298,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) {
30354
30298
  !tagName ||
30355
30299
  tagName === '!' ||
30356
30300
  (tagName === YAMLMap.tagName && expType === 'map') ||
30357
- (tagName === YAMLSeq.tagName && expType === 'seq') ||
30358
- !expType) {
30301
+ (tagName === YAMLSeq.tagName && expType === 'seq')) {
30359
30302
  return resolveCollection(CN, ctx, token, onError, tagName);
30360
30303
  }
30361
30304
  let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
@@ -30923,7 +30866,7 @@ function composeNode(ctx, token, props, onError) {
30923
30866
  case 'block-map':
30924
30867
  case 'block-seq':
30925
30868
  case 'flow-collection':
30926
- node = composeCollection(CN, ctx, token, tag, onError);
30869
+ node = composeCollection(CN, ctx, token, props, onError);
30927
30870
  if (anchor)
30928
30871
  node.anchor = anchor.source.substring(1);
30929
30872
  break;
@@ -31995,15 +31938,11 @@ class Lexer {
31995
31938
  if (!this.atEnd && !this.hasChars(4))
31996
31939
  return this.setNext('line-start');
31997
31940
  const s = this.peek(3);
31998
- if (s === '---' && isEmpty(this.charAt(3))) {
31941
+ if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
31999
31942
  yield* this.pushCount(3);
32000
31943
  this.indentValue = 0;
32001
31944
  this.indentNext = 0;
32002
- return 'doc';
32003
- }
32004
- else if (s === '...' && isEmpty(this.charAt(3))) {
32005
- yield* this.pushCount(3);
32006
- return 'stream';
31945
+ return s === '---' ? 'doc' : 'stream';
32007
31946
  }
32008
31947
  }
32009
31948
  this.indentValue = yield* this.pushSpaces(false);
@@ -35215,7 +35154,7 @@ function buildHtmlPlugin(config) {
35215
35154
  async transform(html, id) {
35216
35155
  if (id.endsWith(".html")) {
35217
35156
  id = normalizePath$3(id);
35218
- const relativeUrlPath = path$n.posix.relative(config.root, id);
35157
+ const relativeUrlPath = normalizePath$3(path$n.relative(config.root, id));
35219
35158
  const publicPath = `/${relativeUrlPath}`;
35220
35159
  const publicBase = getBaseInHTML(relativeUrlPath, config);
35221
35160
  const publicToRelative = (filename, importer) => publicBase + filename;
@@ -35549,7 +35488,9 @@ ${js}`;
35549
35488
  return tags;
35550
35489
  };
35551
35490
  for (const [normalizedId, html] of processedHtml) {
35552
- const relativeUrlPath = path$n.posix.relative(config.root, normalizedId);
35491
+ const relativeUrlPath = normalizePath$3(
35492
+ path$n.relative(config.root, normalizedId)
35493
+ );
35553
35494
  const assetsBase = getBaseInHTML(relativeUrlPath, config);
35554
35495
  const toOutputFilePath = (filename, type) => {
35555
35496
  if (isExternalUrl(filename)) {
@@ -36346,7 +36287,9 @@ function cssPostPlugin(config) {
36346
36287
  const relative = config.base === "./" || config.base === "";
36347
36288
  const cssAssetDirname = encodedPublicUrls || relative ? slash$1(getCssAssetDirname(cssAssetName)) : void 0;
36348
36289
  const toRelative = (filename) => {
36349
- const relativePath = path$n.posix.relative(cssAssetDirname, filename);
36290
+ const relativePath = normalizePath$3(
36291
+ path$n.relative(cssAssetDirname, filename)
36292
+ );
36350
36293
  return relativePath[0] === "." ? relativePath : "./" + relativePath;
36351
36294
  };
36352
36295
  chunkCSS2 = chunkCSS2.replace(assetUrlRE, (_, fileHash, postfix = "") => {
@@ -36364,9 +36307,8 @@ function cssPostPlugin(config) {
36364
36307
  );
36365
36308
  });
36366
36309
  if (encodedPublicUrls) {
36367
- const relativePathToPublicFromCSS = path$n.posix.relative(
36368
- cssAssetDirname,
36369
- ""
36310
+ const relativePathToPublicFromCSS = normalizePath$3(
36311
+ path$n.relative(cssAssetDirname, "")
36370
36312
  );
36371
36313
  chunkCSS2 = chunkCSS2.replace(publicAssetUrlRE, (_, hash) => {
36372
36314
  const publicUrl = publicAssetUrlMap.get(hash).slice(1);
@@ -36988,8 +36930,8 @@ function createCachedImport(imp) {
36988
36930
  return cached;
36989
36931
  };
36990
36932
  }
36991
- const importPostcssImport = createCachedImport(() => import('./dep-y7MNyJvV.js').then(function (n) { return n.i; }));
36992
- const importPostcssModules = createCachedImport(() => import('./dep-Du4V_m3I.js').then(function (n) { return n.i; }));
36933
+ const importPostcssImport = createCachedImport(() => import('./dep-C3NStZH1.js').then(function (n) { return n.i; }));
36934
+ const importPostcssModules = createCachedImport(() => import('./dep-DvdjAuZF.js').then(function (n) { return n.i; }));
36993
36935
  const importPostcss = createCachedImport(() => import('postcss'));
36994
36936
  const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
36995
36937
  let alwaysFakeWorkerWorkerControllerCache;
@@ -45409,8 +45351,8 @@ function launchEditor (file, specifiedEditor, onErrorCallback) {
45409
45351
  // and
45410
45352
  // https://github.com/facebook/create-react-app/pull/5431)
45411
45353
 
45412
- // Allows alphanumeric characters, periods, dashes, slashes, and underscores.
45413
- const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u;
45354
+ // Allows alphanumeric characters, periods, dashes, slashes, underscores, plus and space.
45355
+ const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN = /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-\\_+ ]+$/u;
45414
45356
  if (
45415
45357
  process.platform === 'win32' &&
45416
45358
  !WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())
@@ -47710,7 +47652,7 @@ function webWorkerPlugin(config) {
47710
47652
  }
47711
47653
  if (injectEnv) {
47712
47654
  const s = new MagicString(raw);
47713
- s.prepend(injectEnv);
47655
+ s.prepend(injectEnv + ";\n");
47714
47656
  return {
47715
47657
  code: s.toString(),
47716
47658
  map: s.generateMap({ hires: "boundary" })
@@ -52342,42 +52284,49 @@ Contents of line ${line}: ${code.split("\n")[line - 1]}`
52342
52284
  Object.defineProperty(${ssrModuleExportsKey}, "${name}", { enumerable: true, configurable: true, get(){ return ${local} }});`
52343
52285
  );
52344
52286
  }
52287
+ const imports = [];
52288
+ const exports = [];
52345
52289
  for (const node of ast.body) {
52346
52290
  if (node.type === "ImportDeclaration") {
52347
- const importId = defineImport(hoistIndex, node.source.value, {
52348
- importedNames: node.specifiers.map((s2) => {
52349
- if (s2.type === "ImportSpecifier")
52350
- return s2.imported.type === "Identifier" ? s2.imported.name : (
52351
- // @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
52352
- s2.imported.value
52353
- );
52354
- else if (s2.type === "ImportDefaultSpecifier") return "default";
52355
- }).filter(isDefined)
52356
- });
52357
- s.remove(node.start, node.end);
52358
- for (const spec of node.specifiers) {
52359
- if (spec.type === "ImportSpecifier") {
52360
- if (spec.imported.type === "Identifier") {
52361
- idToImportMap.set(
52362
- spec.local.name,
52363
- `${importId}.${spec.imported.name}`
52364
- );
52365
- } else {
52366
- idToImportMap.set(
52367
- spec.local.name,
52368
- `${importId}[${// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
52369
- JSON.stringify(spec.imported.value)}]`
52370
- );
52371
- }
52372
- } else if (spec.type === "ImportDefaultSpecifier") {
52373
- idToImportMap.set(spec.local.name, `${importId}.default`);
52291
+ imports.push(node);
52292
+ } else if (node.type === "ExportNamedDeclaration" || node.type === "ExportDefaultDeclaration" || node.type === "ExportAllDeclaration") {
52293
+ exports.push(node);
52294
+ }
52295
+ }
52296
+ for (const node of imports) {
52297
+ const importId = defineImport(hoistIndex, node.source.value, {
52298
+ importedNames: node.specifiers.map((s2) => {
52299
+ if (s2.type === "ImportSpecifier")
52300
+ return s2.imported.type === "Identifier" ? s2.imported.name : (
52301
+ // @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
52302
+ s2.imported.value
52303
+ );
52304
+ else if (s2.type === "ImportDefaultSpecifier") return "default";
52305
+ }).filter(isDefined)
52306
+ });
52307
+ s.remove(node.start, node.end);
52308
+ for (const spec of node.specifiers) {
52309
+ if (spec.type === "ImportSpecifier") {
52310
+ if (spec.imported.type === "Identifier") {
52311
+ idToImportMap.set(
52312
+ spec.local.name,
52313
+ `${importId}.${spec.imported.name}`
52314
+ );
52374
52315
  } else {
52375
- idToImportMap.set(spec.local.name, importId);
52316
+ idToImportMap.set(
52317
+ spec.local.name,
52318
+ `${importId}[${// @ts-expect-error TODO: Estree types don't consider arbitrary module namespace specifiers yet
52319
+ JSON.stringify(spec.imported.value)}]`
52320
+ );
52376
52321
  }
52322
+ } else if (spec.type === "ImportDefaultSpecifier") {
52323
+ idToImportMap.set(spec.local.name, `${importId}.default`);
52324
+ } else {
52325
+ idToImportMap.set(spec.local.name, importId);
52377
52326
  }
52378
52327
  }
52379
52328
  }
52380
- for (const node of ast.body) {
52329
+ for (const node of exports) {
52381
52330
  if (node.type === "ExportNamedDeclaration") {
52382
52331
  if (node.declaration) {
52383
52332
  if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
@@ -52771,13 +52720,13 @@ function ssrFixStacktrace(e, moduleGraph) {
52771
52720
  const pendingModules = /* @__PURE__ */ new Map();
52772
52721
  const pendingModuleDependencyGraph = /* @__PURE__ */ new Map();
52773
52722
  const importErrors = /* @__PURE__ */ new WeakMap();
52774
- async function ssrLoadModule(url, server, context = { global }, fixStacktrace) {
52723
+ async function ssrLoadModule(url, server, fixStacktrace) {
52775
52724
  url = unwrapId$1(url);
52776
52725
  const pending = pendingModules.get(url);
52777
52726
  if (pending) {
52778
52727
  return pending;
52779
52728
  }
52780
- const modulePromise = instantiateModule(url, server, context, fixStacktrace);
52729
+ const modulePromise = instantiateModule(url, server, fixStacktrace);
52781
52730
  pendingModules.set(url, modulePromise);
52782
52731
  modulePromise.catch(() => {
52783
52732
  }).finally(() => {
@@ -52785,7 +52734,7 @@ async function ssrLoadModule(url, server, context = { global }, fixStacktrace) {
52785
52734
  });
52786
52735
  return modulePromise;
52787
52736
  }
52788
- async function instantiateModule(url, server, context = { global }, fixStacktrace) {
52737
+ async function instantiateModule(url, server, fixStacktrace) {
52789
52738
  const { moduleGraph } = server;
52790
52739
  const mod = await moduleGraph.ensureEntryFromUrl(url, true);
52791
52740
  if (mod.ssrError) {
@@ -52849,7 +52798,7 @@ async function instantiateModule(url, server, context = { global }, fixStacktrac
52849
52798
  return depSsrModule;
52850
52799
  }
52851
52800
  }
52852
- return ssrLoadModule(dep, server, context, fixStacktrace);
52801
+ return ssrLoadModule(dep, server, fixStacktrace);
52853
52802
  } catch (err) {
52854
52803
  importErrors.set(err, { importee: dep });
52855
52804
  throw err;
@@ -52884,7 +52833,6 @@ async function instantiateModule(url, server, context = { global }, fixStacktrac
52884
52833
  }
52885
52834
  try {
52886
52835
  const initModule = new AsyncFunction(
52887
- `global`,
52888
52836
  ssrModuleExportsKey,
52889
52837
  ssrImportMetaKey,
52890
52838
  ssrImportKey,
@@ -52894,7 +52842,6 @@ async function instantiateModule(url, server, context = { global }, fixStacktrac
52894
52842
  //# sourceURL=${mod.id}${sourceMapSuffix}`
52895
52843
  );
52896
52844
  await initModule(
52897
- context.global,
52898
52845
  ssrModule,
52899
52846
  ssrImportMeta,
52900
52847
  ssrImport,
@@ -62779,7 +62726,7 @@ async function _createServer(inlineConfig = {}, options) {
62779
62726
  return devHtmlTransformFn(server, url, html, originalUrl);
62780
62727
  },
62781
62728
  async ssrLoadModule(url, opts) {
62782
- return ssrLoadModule(url, server, void 0, opts?.fixStacktrace);
62729
+ return ssrLoadModule(url, server, opts?.fixStacktrace);
62783
62730
  },
62784
62731
  async ssrFetchModule(url, importer) {
62785
62732
  return ssrFetchModule(server, url, importer);