vite 2.9.0-beta.4 → 2.9.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

@@ -498,7 +498,7 @@ function setup(env) {
498
498
  namespaces = split[i].replace(/\*/g, '.*?');
499
499
 
500
500
  if (namespaces[0] === '-') {
501
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
501
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
502
502
  } else {
503
503
  createDebug.names.push(new RegExp('^' + namespaces + '$'));
504
504
  }
@@ -1394,7 +1394,7 @@ const schemeRegex = /^[\w+.-]+:\/\//;
1394
1394
  * 4. Port, including ":", optional.
1395
1395
  * 5. Path, including "/", optional.
1396
1396
  */
1397
- const urlRegex = /^([\w+.-]+:)\/\/([^@]*@)?([^:/]*)(:\d+)?(\/[^#?]*)?/;
1397
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/;
1398
1398
  function isAbsoluteUrl(input) {
1399
1399
  return schemeRegex.test(input);
1400
1400
  }
@@ -2482,6 +2482,24 @@ async function processSrcSet(srcs, replacer) {
2482
2482
  url + ` ${descriptor}${index === ret.length - 1 ? '' : ', '}`);
2483
2483
  }, '');
2484
2484
  }
2485
+ function escapeToLinuxLikePath(path) {
2486
+ if (/^[A-Z]:/.test(path)) {
2487
+ return path.replace(/^([A-Z]):\//, '/windows/$1/');
2488
+ }
2489
+ if (/^\/[^/]/.test(path)) {
2490
+ return `/linux${path}`;
2491
+ }
2492
+ return path;
2493
+ }
2494
+ function unescapeToLinuxLikePath(path) {
2495
+ if (path.startsWith('/linux/')) {
2496
+ return path.slice('/linux'.length);
2497
+ }
2498
+ if (path.startsWith('/windows/')) {
2499
+ return path.replace(/^\/windows\/([A-Z])\//, '$1:/');
2500
+ }
2501
+ return path;
2502
+ }
2485
2503
  // based on https://github.com/sveltejs/svelte/blob/abf11bb02b2afbd3e4cac509a0f70e318c306364/src/compiler/utils/mapped_code.ts#L221
2486
2504
  const nullSourceMap = {
2487
2505
  names: [],
@@ -2494,6 +2512,15 @@ function combineSourcemaps(filename, sourcemapList) {
2494
2512
  sourcemapList.every((m) => m.sources.length === 0)) {
2495
2513
  return { ...nullSourceMap };
2496
2514
  }
2515
+ // hack for parse broken with normalized absolute paths on windows (C:/path/to/something).
2516
+ // escape them to linux like paths
2517
+ sourcemapList.forEach((sourcemap) => {
2518
+ sourcemap.sources = sourcemap.sources.map((source) => source ? escapeToLinuxLikePath(source) : null);
2519
+ if (sourcemap.sourceRoot) {
2520
+ sourcemap.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot);
2521
+ }
2522
+ });
2523
+ const escapedFilename = escapeToLinuxLikePath(filename);
2497
2524
  // We don't declare type here so we can convert/fake/map as RawSourceMap
2498
2525
  let map; //: SourceMap
2499
2526
  let mapIndex = 1;
@@ -2503,17 +2530,20 @@ function combineSourcemaps(filename, sourcemapList) {
2503
2530
  }
2504
2531
  else {
2505
2532
  map = remapping(sourcemapList[0], function loader(sourcefile) {
2506
- if (sourcefile === filename && sourcemapList[mapIndex]) {
2533
+ if (sourcefile === escapedFilename && sourcemapList[mapIndex]) {
2507
2534
  return sourcemapList[mapIndex++];
2508
2535
  }
2509
2536
  else {
2510
- return { ...nullSourceMap };
2537
+ return null;
2511
2538
  }
2512
2539
  }, true);
2513
2540
  }
2514
2541
  if (!map.file) {
2515
2542
  delete map.file;
2516
2543
  }
2544
+ // unescape the previous hack
2545
+ map.sources = map.sources.map((source) => source ? unescapeToLinuxLikePath(source) : source);
2546
+ map.file = filename;
2517
2547
  return map;
2518
2548
  }
2519
2549
  function resolveHostname(optionsHost) {
@@ -4478,7 +4508,9 @@ function assetPlugin(config) {
4478
4508
  const file = getAssetFilename(hash, config) || this.getFileName(hash);
4479
4509
  chunk.viteMetadata.importedAssets.add(cleanUrl(file));
4480
4510
  const outputFilepath = config.base + file + postfix;
4481
- s.overwrite(match.index, match.index + full.length, outputFilepath);
4511
+ s.overwrite(match.index, match.index + full.length, outputFilepath, {
4512
+ contentOnly: true
4513
+ });
4482
4514
  }
4483
4515
  if (s) {
4484
4516
  return {
@@ -18546,6 +18578,62 @@ const dataToEsm = function dataToEsm(data, options = {}) {
18546
18578
  return `${namedExportCode}export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`;
18547
18579
  };
18548
18580
 
18581
+ const isDebug$6 = !!process.env.DEBUG;
18582
+ const debug$f = createDebugger('vite:sourcemap', {
18583
+ onlyWhenFocused: true
18584
+ });
18585
+ // Virtual modules should be prefixed with a null byte to avoid a
18586
+ // false positive "missing source" warning. We also check for certain
18587
+ // prefixes used for special handling in esbuildDepPlugin.
18588
+ const virtualSourceRE = /^(\0|dep:|browser-external:)/;
18589
+ async function injectSourcesContent(map, file, logger) {
18590
+ let sourceRoot;
18591
+ try {
18592
+ // The source root is undefined for virtual modules and permission errors.
18593
+ sourceRoot = await fs$n.promises.realpath(path__default.resolve(path__default.dirname(file), map.sourceRoot || ''));
18594
+ }
18595
+ catch { }
18596
+ const missingSources = [];
18597
+ map.sourcesContent = await Promise.all(map.sources.map((sourcePath) => {
18598
+ if (sourcePath && !virtualSourceRE.test(sourcePath)) {
18599
+ sourcePath = decodeURI(sourcePath);
18600
+ if (sourceRoot) {
18601
+ sourcePath = path__default.resolve(sourceRoot, sourcePath);
18602
+ }
18603
+ return fs$n.promises.readFile(sourcePath, 'utf-8').catch(() => {
18604
+ missingSources.push(sourcePath);
18605
+ return null;
18606
+ });
18607
+ }
18608
+ return null;
18609
+ }));
18610
+ // Use this command…
18611
+ // DEBUG="vite:sourcemap" vite build
18612
+ // …to log the missing sources.
18613
+ if (missingSources.length) {
18614
+ logger.warnOnce(`Sourcemap for "${file}" points to missing source files`);
18615
+ isDebug$6 && debug$f(`Missing sources:\n ` + missingSources.join(`\n `));
18616
+ }
18617
+ }
18618
+ function genSourceMapUrl(map) {
18619
+ if (typeof map !== 'string') {
18620
+ map = JSON.stringify(map);
18621
+ }
18622
+ return `data:application/json;base64,${Buffer.from(map).toString('base64')}`;
18623
+ }
18624
+ function getCodeWithSourcemap(type, code, map) {
18625
+ if (isDebug$6) {
18626
+ code += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n`;
18627
+ }
18628
+ if (type === 'js') {
18629
+ code += `\n//# sourceMappingURL=${genSourceMapUrl(map !== null && map !== void 0 ? map : undefined)}`;
18630
+ }
18631
+ else if (type === 'css') {
18632
+ code += `\n/*# sourceMappingURL=${genSourceMapUrl(map !== null && map !== void 0 ? map : undefined)} */`;
18633
+ }
18634
+ return code;
18635
+ }
18636
+
18549
18637
  const cssLangs = `\\.(css|less|sass|scss|styl|stylus|pcss|postcss)($|\\?)`;
18550
18638
  const cssLangRE = new RegExp(cssLangs);
18551
18639
  const cssModuleRE = new RegExp(`\\.module${cssLangs}`);
@@ -18600,7 +18688,7 @@ function cssPlugin(config) {
18600
18688
  }
18601
18689
  return url;
18602
18690
  };
18603
- const { code: css, modules, deps } = await compileCSS(id, raw, config, urlReplacer, atImportResolvers, server);
18691
+ const { code: css, modules, deps, map } = await compileCSS(id, raw, config, urlReplacer, atImportResolvers, server);
18604
18692
  if (modules) {
18605
18693
  moduleCache.set(id, modules);
18606
18694
  }
@@ -18642,8 +18730,7 @@ function cssPlugin(config) {
18642
18730
  }
18643
18731
  return {
18644
18732
  code: css,
18645
- // TODO CSS source map
18646
- map: { mappings: '' }
18733
+ map
18647
18734
  };
18648
18735
  }
18649
18736
  };
@@ -18686,10 +18773,13 @@ function cssPostPlugin(config) {
18686
18773
  if (inlined) {
18687
18774
  return `export default ${JSON.stringify(css)}`;
18688
18775
  }
18776
+ const sourcemap = this.getCombinedSourcemap();
18777
+ await injectSourcesContent(sourcemap, cleanUrl(id), config.logger);
18778
+ const cssContent = getCodeWithSourcemap('css', css, sourcemap);
18689
18779
  return [
18690
18780
  `import { updateStyle as __vite__updateStyle, removeStyle as __vite__removeStyle } from ${JSON.stringify(path__default.posix.join(config.base, CLIENT_PUBLIC_PATH))}`,
18691
18781
  `const __vite__id = ${JSON.stringify(id)}`,
18692
- `const __vite__css = ${JSON.stringify(css)}`,
18782
+ `const __vite__css = ${JSON.stringify(cssContent)}`,
18693
18783
  `__vite__updateStyle(__vite__id, __vite__css)`,
18694
18784
  // css modules exports change on edit so it can't self accept
18695
18785
  `${modulesCode ||
@@ -18928,9 +19018,9 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
18928
19018
  !isModule &&
18929
19019
  !needInlineImport &&
18930
19020
  !hasUrl) {
18931
- return { code };
19021
+ return { code, map: null };
18932
19022
  }
18933
- let map;
19023
+ let preprocessorMap;
18934
19024
  let modules;
18935
19025
  const deps = new Set();
18936
19026
  // 2. pre-processors: sass etc.
@@ -18963,7 +19053,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
18963
19053
  throw preprocessResult.errors[0];
18964
19054
  }
18965
19055
  code = preprocessResult.code;
18966
- map = preprocessResult.map;
19056
+ preprocessorMap = combineSourcemapsIfExists(opts.filename, preprocessResult.map, preprocessResult.additionalMap);
18967
19057
  if (preprocessResult.deps) {
18968
19058
  preprocessResult.deps.forEach((dep) => {
18969
19059
  // sometimes sass registers the file itself as a dep
@@ -18996,7 +19086,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
18996
19086
  replacer: urlReplacer
18997
19087
  }));
18998
19088
  if (isModule) {
18999
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-0d07874d.js'); }).then(function (n) { return n.index; })).default({
19089
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-b1024ee7.js'); }).then(function (n) { return n.index; })).default({
19000
19090
  ...modulesOptions,
19001
19091
  getJSON(cssFileName, _modules, outputFileName) {
19002
19092
  modules = _modules;
@@ -19018,7 +19108,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
19018
19108
  if (!postcssPlugins.length) {
19019
19109
  return {
19020
19110
  code,
19021
- map
19111
+ map: preprocessorMap
19022
19112
  };
19023
19113
  }
19024
19114
  // postcss is an unbundled dep and should be lazy imported
@@ -19026,12 +19116,14 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
19026
19116
  .default(postcssPlugins)
19027
19117
  .process(code, {
19028
19118
  ...postcssOptions,
19029
- to: id,
19030
- from: id,
19119
+ to: cleanUrl(id),
19120
+ from: cleanUrl(id),
19031
19121
  map: {
19032
19122
  inline: false,
19033
19123
  annotation: false,
19034
- prev: map
19124
+ sourcesContent: false
19125
+ // when "prev: preprocessorMap", the result map may include duplicate filename in `postcssResult.map.sources`
19126
+ // prev: preprocessorMap,
19035
19127
  }
19036
19128
  });
19037
19129
  // record CSS dependencies from @imports
@@ -19074,14 +19166,46 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
19074
19166
  config.logger.warn(colors$1.yellow(msg));
19075
19167
  }
19076
19168
  }
19169
+ const rawPostcssMap = postcssResult.map.toJSON();
19170
+ const postcssMap = formatPostcssSourceMap(
19171
+ // version property of rawPostcssMap is declared as string
19172
+ // but actually it is a number
19173
+ rawPostcssMap, cleanUrl(id));
19077
19174
  return {
19078
19175
  ast: postcssResult,
19079
19176
  code: postcssResult.css,
19080
- map: postcssResult.map,
19177
+ map: combineSourcemapsIfExists(cleanUrl(id), postcssMap, preprocessorMap),
19081
19178
  modules,
19082
19179
  deps
19083
19180
  };
19084
19181
  }
19182
+ function formatPostcssSourceMap(rawMap, file) {
19183
+ const inputFileDir = path__default.dirname(file);
19184
+ const sources = rawMap.sources
19185
+ // remove <no source> from sources, to prevent source map to be combined incorrectly
19186
+ .filter((source) => source !== '<no source>')
19187
+ .map((source) => {
19188
+ const cleanSource = cleanUrl(decodeURIComponent(source));
19189
+ return normalizePath$4(path__default.resolve(inputFileDir, cleanSource));
19190
+ });
19191
+ return {
19192
+ file,
19193
+ mappings: rawMap.mappings,
19194
+ names: rawMap.names,
19195
+ sources,
19196
+ version: rawMap.version
19197
+ };
19198
+ }
19199
+ function combineSourcemapsIfExists(filename, map1, map2) {
19200
+ return map1 && map2
19201
+ ? combineSourcemaps(filename, [
19202
+ // type of version property of ExistingRawSourceMap is number
19203
+ // but it is always 3
19204
+ map1,
19205
+ map2
19206
+ ])
19207
+ : map1;
19208
+ }
19085
19209
  async function resolvePostcssConfig(config) {
19086
19210
  var _a;
19087
19211
  let result = postcssConfigCache.get(config);
@@ -19271,12 +19395,16 @@ const scss = async (source, root, options, resolvers) => {
19271
19395
  ? importer.push(...options.importer)
19272
19396
  : importer.push(options.importer);
19273
19397
  }
19398
+ const { content: data, map: additionalMap } = await getSource(source, options.filename, options.additionalData);
19274
19399
  const finalOptions = {
19275
19400
  ...options,
19276
- data: await getSource(source, options.filename, options.additionalData),
19401
+ data,
19277
19402
  file: options.filename,
19278
19403
  outFile: options.filename,
19279
- importer
19404
+ importer,
19405
+ sourceMap: true,
19406
+ omitSourceMapUrl: true,
19407
+ sourceMapRoot: path__default.dirname(options.filename)
19280
19408
  };
19281
19409
  try {
19282
19410
  const result = await new Promise((resolve, reject) => {
@@ -19290,8 +19418,13 @@ const scss = async (source, root, options, resolvers) => {
19290
19418
  });
19291
19419
  });
19292
19420
  const deps = result.stats.includedFiles;
19421
+ const map = result.map
19422
+ ? JSON.parse(result.map.toString())
19423
+ : undefined;
19293
19424
  return {
19294
19425
  code: result.css.toString(),
19426
+ map,
19427
+ additionalMap,
19295
19428
  errors: [],
19296
19429
  deps
19297
19430
  };
@@ -19358,12 +19491,16 @@ async function rebaseUrls(file, rootFile, alias) {
19358
19491
  const less = async (source, root, options, resolvers) => {
19359
19492
  const nodeLess = loadPreprocessor("less" /* less */, root);
19360
19493
  const viteResolverPlugin = createViteLessPlugin(nodeLess, options.filename, options.alias, resolvers);
19361
- source = await getSource(source, options.filename, options.additionalData);
19494
+ const { content, map: additionalMap } = await getSource(source, options.filename, options.additionalData);
19362
19495
  let result;
19363
19496
  try {
19364
- result = await nodeLess.render(source, {
19497
+ result = await nodeLess.render(content, {
19365
19498
  ...options,
19366
- plugins: [viteResolverPlugin, ...(options.plugins || [])]
19499
+ plugins: [viteResolverPlugin, ...(options.plugins || [])],
19500
+ sourceMap: {
19501
+ outputSourceFiles: true,
19502
+ sourceMapFileInline: false
19503
+ }
19367
19504
  });
19368
19505
  }
19369
19506
  catch (e) {
@@ -19377,8 +19514,12 @@ const less = async (source, root, options, resolvers) => {
19377
19514
  };
19378
19515
  return { code: '', errors: [normalizedError], deps: [] };
19379
19516
  }
19517
+ const map = JSON.parse(result.map);
19518
+ delete map.sourcesContent;
19380
19519
  return {
19381
19520
  code: result.css.toString(),
19521
+ map,
19522
+ additionalMap,
19382
19523
  deps: result.imports,
19383
19524
  errors: []
19384
19525
  };
@@ -19437,29 +19578,63 @@ const styl = async (source, root, options) => {
19437
19578
  const nodeStylus = loadPreprocessor("stylus" /* stylus */, root);
19438
19579
  // Get source with preprocessor options.additionalData. Make sure a new line separator
19439
19580
  // is added to avoid any render error, as added stylus content may not have semi-colon separators
19440
- source = await getSource(source, options.filename, options.additionalData, '\n');
19581
+ const { content, map: additionalMap } = await getSource(source, options.filename, options.additionalData, '\n');
19441
19582
  // Get preprocessor options.imports dependencies as stylus
19442
19583
  // does not return them with its builtin `.deps()` method
19443
19584
  const importsDeps = ((_a = options.imports) !== null && _a !== void 0 ? _a : []).map((dep) => path__default.resolve(dep));
19444
19585
  try {
19445
- const ref = nodeStylus(source, options);
19446
- // if (map) ref.set('sourcemap', { inline: false, comment: false })
19586
+ const ref = nodeStylus(content, options);
19587
+ ref.set('sourcemap', {
19588
+ comment: false,
19589
+ inline: false,
19590
+ basePath: root
19591
+ });
19447
19592
  const result = ref.render();
19448
19593
  // Concat imports deps with computed deps
19449
19594
  const deps = [...ref.deps(), ...importsDeps];
19450
- return { code: result, errors: [], deps };
19595
+ // @ts-expect-error sourcemap exists
19596
+ const map = ref.sourcemap;
19597
+ return {
19598
+ code: result,
19599
+ map: formatStylusSourceMap(map, root),
19600
+ additionalMap,
19601
+ errors: [],
19602
+ deps
19603
+ };
19451
19604
  }
19452
19605
  catch (e) {
19453
19606
  return { code: '', errors: [e], deps: [] };
19454
19607
  }
19455
19608
  };
19456
- function getSource(source, filename, additionalData, sep = '') {
19609
+ function formatStylusSourceMap(mapBefore, root) {
19610
+ const map = { ...mapBefore };
19611
+ const resolveFromRoot = (p) => normalizePath$4(path__default.resolve(root, p));
19612
+ if (map.file) {
19613
+ map.file = resolveFromRoot(map.file);
19614
+ }
19615
+ map.sources = map.sources.map(resolveFromRoot);
19616
+ return map;
19617
+ }
19618
+ async function getSource(source, filename, additionalData, sep = '') {
19457
19619
  if (!additionalData)
19458
- return source;
19620
+ return { content: source };
19459
19621
  if (typeof additionalData === 'function') {
19460
- return additionalData(source, filename);
19461
- }
19462
- return additionalData + sep + source;
19622
+ const newContent = await additionalData(source, filename);
19623
+ if (typeof newContent === 'string') {
19624
+ return { content: newContent };
19625
+ }
19626
+ return newContent;
19627
+ }
19628
+ const ms = new MagicString$1(source);
19629
+ ms.appendLeft(0, sep);
19630
+ ms.appendLeft(0, additionalData);
19631
+ const map = ms.generateMap({ hires: true });
19632
+ map.file = filename;
19633
+ map.sources = [filename];
19634
+ return {
19635
+ content: ms.toString(),
19636
+ map
19637
+ };
19463
19638
  }
19464
19639
  const preProcessors = Object.freeze({
19465
19640
  ["less" /* less */]: less,
@@ -19472,7 +19647,7 @@ function isPreProcessor(lang) {
19472
19647
  return lang && lang in preProcessors;
19473
19648
  }
19474
19649
 
19475
- /* es-module-lexer 0.10.0 */
19650
+ /* es-module-lexer 0.10.1 */
19476
19651
  const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$f(E,g="@"){if(!C)return init.then(()=>parse$f(E));const I=E.length+1,o=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;o>0&&C.memory.grow(Math.ceil(o/65536));const k=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,k,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const J=[],i=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.ai(),g=C.id(),I=C.ss(),o=C.se();let k;C.ip()&&(k=w(E.slice(-1===g?A-1:A,-1===g?Q+1:Q))),J.push({n:k,s:A,e:Q,ss:I,se:o,d:g,a:B});}for(;C.re();){const A=E.slice(C.es(),C.ee()),Q=A[0];i.push('"'===Q||"'"===Q?w(A):A);}function w(A){try{return (0, eval)(A)}catch(A){}}return [J,i,!!C.f()]}function Q(A,Q){const B=A.length;let C=0;for(;C<B;){const B=A.charCodeAt(C);Q[C++]=(255&B)<<8|B>>>8;}}function B(A,Q){const B=A.length;let C=0;for(;C<B;)Q[C]=A.charCodeAt(C++);}let C;const init=WebAssembly.compile((E="AGFzbQEAAAABKghgAX8Bf2AEf39/fwBgAn9/AGAAAX9gAABgAX8AYAN/f38Bf2ACf38BfwMqKQABAgMDAwMDAwMDAwMDAwMAAAQEBAUEBQAAAAAEBAAGBwACAAAABwMGBAUBcAEBAQUDAQABBg8CfwFBkPIAC38AQZDyAAsHZBEGbWVtb3J5AgACc2EAAAFlAAMCaXMABAJpZQAFAnNzAAYCc2UABwJhaQAIAmlkAAkCaXAACgJlcwALAmVlAAwCcmkADQJyZQAOAWYADwVwYXJzZQAQC19faGVhcF9iYXNlAwEKhjQpaAEBf0EAIAA2AtQJQQAoArAJIgEgAEEBdGoiAEEAOwEAQQAgAEECaiIANgLYCUEAIAA2AtwJQQBBADYCtAlBAEEANgLECUEAQQA2ArwJQQBBADYCuAlBAEEANgLMCUEAQQA2AsAJIAELnwEBA39BACgCxAkhBEEAQQAoAtwJIgU2AsQJQQAgBDYCyAlBACAFQSBqNgLcCSAEQRxqQbQJIAQbIAU2AgBBACgCqAkhBEEAKAKkCSEGIAUgATYCACAFIAA2Aggg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gAy8BChAeRQ0AQQAgA0EKajYCiApBARAhIQJBACgCiAohAyACECQaIANBACgCiAoQAkEAQQAoAogKQX5qNgKICg8LQQAgA0EEaiIDNgKICgtBACADQQRqIgI2AogKQQBBADoA5AkDQEEAIAJBAmo2AogKQQEQISEDQQAoAogKIQICQCADECRBIHJB+wBHDQBBAEEAKAKICkF+ajYCiAoPC0EAKAKICiIDIAJGDQEgAiADEAICQEEBECEiAkEsRg0AAkAgAkE9Rw0AQQBBACgCiApBfmo2AogKDwtBAEEAKAKICkF+ajYCiAoPC0EAKAKICiECDAALCw8LQQAgA0EKajYCiApBARAhGkEAKAKICiEDC0EAIANBEGo2AogKAkBBARAhIgJBKkcNAEEAQQAoAogKQQJqNgKICkEBECEhAgtBACgCiAohAyACECQaIANBACgCiAoQAkEAQQAoAogKQX5qNgKICg8LIAMgA0EOahACC6sGAQR/QQBBACgCiAoiAEEMaiIBNgKICgJAAkACQAJAAkACQAJAAkACQAJAQQEQISICQVlqDggCCAECAQEBBwALIAJBIkYNASACQfsARg0CC0EAKAKICiABRg0HC0EALwHqCQ0BQQAoAogKIQJBACgCjAohAwNAIAIgA08NBAJAAkAgAi8BACIBQSdGDQAgAUEiRw0BCyAAIAEQIg8LQQAgAkECaiICNgKICgwACwtBACgCiAohAkEALwHqCQ0BAkADQAJAAkACQCACQQAoAowKTw0AQQEQISICQSJGDQEgAkEnRg0BIAJB/QBHDQJBAEEAKAKICkECajYCiAoLQQEQIRpBACgCiAoiAikAAELmgMiD8I3ANlINBkEAIAJBCGo2AogKQQEQISICQSJGDQMgAkEnRg0DDAYLIAIQFwtBAEEAKAKICkECaiICNgKICgwACwsgACACECIMBQtBAEEAKAKICkF+ajYCiAoPC0EAIAJBfmo2AogKDwsQHQ8LQQBBACgCiApBAmo2AogKQQEQIUHtAEcNAUEAKAKICiICQQJqQZYIQQYQKA0BQQAoAvAJLwEAQS5GDQEgACAAIAJBCGpBACgCqAkQAQ8LQQAoAvwJQQAvAeoJIgJBAnRqQQAoAogKNgIAQQAgAkEBajsB6glBACgC8AkvAQBBLkYNAEEAQQAoAogKIgFBAmo2AogKQQEQISECIABBACgCiApBACABEAFBAEEALwHoCSIBQQFqOwHoCUEAKAKACiABQQJ0akEAKALECTYCAAJAIAJBIkYNACACQSdGDQBBAEEAKAKICkF+ajYCiAoPCyACEBdBAEEAKAKICkECaiICNgKICgJAAkACQEEBECFBV2oOBAECAgACC0EAQQAoAogKQQJqNgKICkEBECEaQQAoAsQJIgEgAjYCBCABQQE6ABggAUEAKAKICiICNgIQQQAgAkF+ajYCiAoPC0EAKALECSIBIAI2AgQgAUEBOgAYQQBBAC8B6glBf2o7AeoJIAFBACgCiApBAmo2AgxBAEEALwHoCUF/ajsB6AkPC0EAQQAoAogKQX5qNgKICg8LC0cBA39BACgCiApBAmohAEEAKAKMCiEBAkADQCAAIgJBfmogAU8NASACQQJqIQAgAi8BAEF2ag4EAQAAAQALC0EAIAI2AogKC5gBAQN/QQBBACgCiAoiAUECajYCiAogAUEGaiEBQQAoAowKIQIDQAJAAkACQCABQXxqIAJPDQAgAUF+ai8BACEDAkACQCAADQAgA0EqRg0BIANBdmoOBAIEBAIECyADQSpHDQMLIAEvAQBBL0cNAkEAIAFBfmo2AogKDAELIAFBfmohAQtBACABNgKICg8LIAFBAmohAQwACwu/AQEEf0EAKAKICiEAQQAoAowKIQECQAJAA0AgACICQQJqIQAgAiABTw0BAkACQCAALwEAIgNBpH9qDgUBAgICBAALIANBJEcNASACLwEEQfsARw0BQQBBAC8B5gkiAEEBajsB5glBACgC+AkgAEEBdGpBAC8B7Ak7AQBBACACQQRqNgKICkEAQQAvAeoJQQFqIgA7AewJQQAgADsB6gkPCyACQQRqIQAMAAsLQQAgADYCiAoQHQ8LQQAgADYCiAoLiAEBBH9BACgCiAohAUEAKAKMCiECAkACQANAIAEiA0ECaiEBIAMgAk8NASABLwEAIgQgAEYNAgJAIARB3ABGDQAgBEF2ag4EAgEBAgELIANBBGohASADLwEEQQ1HDQAgA0EG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","undefined"!=typeof Buffer?Buffer.from(E,"base64"):Uint8Array.from(atob(E),A=>A.charCodeAt(0)))).then(WebAssembly.instantiate).then(({exports:A})=>{C=A;});var E;
19477
19652
 
19478
19653
  // This is a generated file. Do not edit.
@@ -21166,7 +21341,7 @@ function buildImportAnalysisPlugin(config) {
21166
21341
  source.slice(end, end + 5) === '.glob') {
21167
21342
  const { importsString, exp, endIndex, isEager } = await transformImportGlob(source, start, importer, index, config.root, config.logger, undefined, resolve, insertPreload);
21168
21343
  str().prepend(importsString);
21169
- str().overwrite(expStart, endIndex, exp);
21344
+ str().overwrite(expStart, endIndex, exp, { contentOnly: true });
21170
21345
  if (!isEager) {
21171
21346
  needPreloadHelper = true;
21172
21347
  }
@@ -21176,7 +21351,7 @@ function buildImportAnalysisPlugin(config) {
21176
21351
  needPreloadHelper = true;
21177
21352
  const original = source.slice(expStart, expEnd);
21178
21353
  const replacement = `${preloadMethod}(() => ${original},${isModernFlag}?"${preloadMarker}":void 0)`;
21179
- str().overwrite(expStart, expEnd, replacement);
21354
+ str().overwrite(expStart, expEnd, replacement, { contentOnly: true });
21180
21355
  }
21181
21356
  // Differentiate CSS imports that use the default export from those that
21182
21357
  // do not by injecting a ?used query - this allows us to avoid including
@@ -21188,7 +21363,9 @@ function buildImportAnalysisPlugin(config) {
21188
21363
  // edge case for package names ending with .css (e.g normalize.css)
21189
21364
  !(bareImportRE.test(specifier) && !specifier.includes('/'))) {
21190
21365
  const url = specifier.replace(/\?|$/, (m) => `?used${m ? '&' : ''}`);
21191
- str().overwrite(start, end, dynamicIndex > -1 ? `'${url}'` : url);
21366
+ str().overwrite(start, end, dynamicIndex > -1 ? `'${url}'` : url, {
21367
+ contentOnly: true
21368
+ });
21192
21369
  }
21193
21370
  }
21194
21371
  if (needPreloadHelper &&
@@ -21212,7 +21389,7 @@ function buildImportAnalysisPlugin(config) {
21212
21389
  const s = new MagicString$1(code);
21213
21390
  let match;
21214
21391
  while ((match = re.exec(code))) {
21215
- s.overwrite(match.index, match.index + isModernFlag.length, isModern);
21392
+ s.overwrite(match.index, match.index + isModernFlag.length, isModern, { contentOnly: true });
21216
21393
  }
21217
21394
  return {
21218
21395
  code: s.toString(),
@@ -21284,7 +21461,9 @@ function buildImportAnalysisPlugin(config) {
21284
21461
  });
21285
21462
  hasRemovedPureCssChunk = true;
21286
21463
  }
21287
- s.overwrite(expStart, expEnd, 'Promise.resolve({})');
21464
+ s.overwrite(expStart, expEnd, 'Promise.resolve({})', {
21465
+ contentOnly: true
21466
+ });
21288
21467
  }
21289
21468
  }
21290
21469
  };
@@ -21304,7 +21483,7 @@ function buildImportAnalysisPlugin(config) {
21304
21483
  // main chunk is removed
21305
21484
  (hasRemovedPureCssChunk && deps.size > 0)
21306
21485
  ? `[${[...deps].map((d) => JSON.stringify(d)).join(',')}]`
21307
- : `[]`);
21486
+ : `[]`, { contentOnly: true });
21308
21487
  }
21309
21488
  }
21310
21489
  chunk.code = s.toString();
@@ -21453,7 +21632,7 @@ const assetAttrsConfig = {
21453
21632
  const isAsyncScriptMap = new WeakMap();
21454
21633
  async function traverseHtml(html, filePath, visitor) {
21455
21634
  // lazy load compiler
21456
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-8a000299.js'); }).then(function (n) { return n.compilerDom_cjs; });
21635
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-5ae06c1f.js'); }).then(function (n) { return n.compilerDom_cjs; });
21457
21636
  // @vue/compiler-core doesn't like lowercase doctypes
21458
21637
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
21459
21638
  try {
@@ -21552,7 +21731,7 @@ function buildHtmlPlugin(config) {
21552
21731
  const isPublicFile = !!(url && checkPublicFile(url, config));
21553
21732
  if (isPublicFile) {
21554
21733
  // referencing public dir url, prefix with base
21555
- s.overwrite(src.value.loc.start.offset, src.value.loc.end.offset, `"${config.base + url.slice(1)}"`);
21734
+ s.overwrite(src.value.loc.start.offset, src.value.loc.end.offset, `"${config.base + url.slice(1)}"`, { contentOnly: true });
21556
21735
  }
21557
21736
  if (isModule) {
21558
21737
  inlineModuleIndex++;
@@ -21615,7 +21794,7 @@ function buildHtmlPlugin(config) {
21615
21794
  }
21616
21795
  }
21617
21796
  else if (checkPublicFile(url, config)) {
21618
- s.overwrite(p.value.loc.start.offset, p.value.loc.end.offset, `"${config.base + url.slice(1)}"`);
21797
+ s.overwrite(p.value.loc.start.offset, p.value.loc.end.offset, `"${config.base + url.slice(1)}"`, { contentOnly: true });
21619
21798
  }
21620
21799
  }
21621
21800
  }
@@ -21638,7 +21817,7 @@ function buildHtmlPlugin(config) {
21638
21817
  // will transform with css plugin and cache result with css-post plugin
21639
21818
  js += `\nimport "${id}?html-proxy&inline-css&index=${inlineModuleIndex}.css"`;
21640
21819
  // will transfrom in `applyHtmlTransforms`
21641
- s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `"__VITE_INLINE_CSS__${cleanUrl(id)}_${inlineModuleIndex}__"`);
21820
+ s.overwrite(styleNode.loc.start.offset, styleNode.loc.end.offset, `"__VITE_INLINE_CSS__${cleanUrl(id)}_${inlineModuleIndex}__"`, { contentOnly: true });
21642
21821
  }
21643
21822
  // <style>...</style>
21644
21823
  if (node.tag === 'style' && node.children.length) {
@@ -21675,7 +21854,7 @@ function buildHtmlPlugin(config) {
21675
21854
  const url = attr.name === 'srcset'
21676
21855
  ? await processSrcSet(content, ({ url }) => urlToBuiltUrl(url, id, config, this))
21677
21856
  : await urlToBuiltUrl(content, id, config, this);
21678
- s.overwrite(value.loc.start.offset, value.loc.end.offset, `"${url}"`);
21857
+ s.overwrite(value.loc.start.offset, value.loc.end.offset, `"${url}"`, { contentOnly: true });
21679
21858
  }
21680
21859
  catch (e) {
21681
21860
  if (e.code !== 'ENOENT') {
@@ -21687,10 +21866,12 @@ function buildHtmlPlugin(config) {
21687
21866
  // emit <script>import("./aaa")</script> asset
21688
21867
  for (const { start, end, url } of scriptUrls) {
21689
21868
  if (!isExcludedUrl(url)) {
21690
- s.overwrite(start, end, await urlToBuiltUrl(url, id, config, this));
21869
+ s.overwrite(start, end, await urlToBuiltUrl(url, id, config, this), { contentOnly: true });
21691
21870
  }
21692
21871
  else if (checkPublicFile(url, config)) {
21693
- s.overwrite(start, end, config.base + url.slice(1));
21872
+ s.overwrite(start, end, config.base + url.slice(1), {
21873
+ contentOnly: true
21874
+ });
21694
21875
  }
21695
21876
  }
21696
21877
  processedHtml.set(id, s.toString());
@@ -21806,7 +21987,7 @@ function buildHtmlPlugin(config) {
21806
21987
  s || (s = new MagicString$1(result));
21807
21988
  const { 0: full, 1: scopedName } = match;
21808
21989
  const cssTransformedCode = htmlProxyResult.get(scopedName);
21809
- s.overwrite(match.index, match.index + full.length, cssTransformedCode);
21990
+ s.overwrite(match.index, match.index + full.length, cssTransformedCode, { contentOnly: true });
21810
21991
  }
21811
21992
  if (s) {
21812
21993
  result = s.toString();
@@ -22508,7 +22689,7 @@ var TSConfckParseError = class extends Error {
22508
22689
  }
22509
22690
  };
22510
22691
 
22511
- const debug$f = createDebugger('vite:esbuild');
22692
+ const debug$e = createDebugger('vite:esbuild');
22512
22693
  let server;
22513
22694
  async function transformWithEsbuild(code, filename, options, inMap) {
22514
22695
  var _a, _b, _c;
@@ -22599,7 +22780,7 @@ async function transformWithEsbuild(code, filename, options, inMap) {
22599
22780
  };
22600
22781
  }
22601
22782
  catch (e) {
22602
- debug$f(`esbuild error with options used: `, resolvedOptions);
22783
+ debug$e(`esbuild error with options used: `, resolvedOptions);
22603
22784
  // patch error information
22604
22785
  if (e.errors) {
22605
22786
  e.frame = '';
@@ -36125,7 +36306,7 @@ async function createPluginContainer({ plugins, logger, root, build: { rollupOpt
36125
36306
  combinedMap = m;
36126
36307
  }
36127
36308
  else {
36128
- combinedMap = combineSourcemaps(this.filename, [
36309
+ combinedMap = combineSourcemaps(cleanUrl(this.filename), [
36129
36310
  {
36130
36311
  ...m,
36131
36312
  sourcesContent: combinedMap.sourcesContent
@@ -36298,7 +36479,7 @@ async function createPluginContainer({ plugins, logger, root, build: { rollupOpt
36298
36479
  return container;
36299
36480
  }
36300
36481
 
36301
- const debug$e = createDebugger('vite:deps');
36482
+ const debug$d = createDebugger('vite:deps');
36302
36483
  const htmlTypesRE = /\.(html|vue|svelte|astro)$/;
36303
36484
  // A simple regex to detect import sources. This is only used on
36304
36485
  // <script lang="ts"> blocks in vue (setup only) or svelte files, since
@@ -36349,7 +36530,7 @@ async function scanImports(config) {
36349
36530
  return { deps: {}, missing: {} };
36350
36531
  }
36351
36532
  else {
36352
- debug$e(`Crawling dependencies using entries:\n ${entries.join('\n ')}`);
36533
+ debug$d(`Crawling dependencies using entries:\n ${entries.join('\n ')}`);
36353
36534
  }
36354
36535
  const deps = {};
36355
36536
  const missing = {};
@@ -36366,7 +36547,7 @@ async function scanImports(config) {
36366
36547
  plugins: [...plugins, plugin],
36367
36548
  ...esbuildOptions
36368
36549
  })));
36369
- debug$e(`Scan completed in ${(perf_hooks.performance.now() - start).toFixed(2)}ms:`, deps);
36550
+ debug$d(`Scan completed in ${(perf_hooks.performance.now() - start).toFixed(2)}ms:`, deps);
36370
36551
  return {
36371
36552
  deps,
36372
36553
  missing
@@ -36662,7 +36843,7 @@ async function transformGlob(source, importer, root, loader, resolve, logger) {
36662
36843
  continue;
36663
36844
  const { importsString, exp, endIndex } = await transformImportGlob(source, start, normalizePath$4(importer), index, root, logger, undefined, resolve);
36664
36845
  s.prepend(importsString);
36665
- s.overwrite(expStart, endIndex, exp);
36846
+ s.overwrite(expStart, endIndex, exp, { contentOnly: true });
36666
36847
  }
36667
36848
  return s.toString();
36668
36849
  }
@@ -36704,7 +36885,7 @@ function isScannable(id) {
36704
36885
  return JS_TYPES_RE.test(id) || htmlTypesRE.test(id);
36705
36886
  }
36706
36887
 
36707
- const debug$d = createDebugger('vite:deps');
36888
+ const debug$c = createDebugger('vite:deps');
36708
36889
  const isDebugEnabled = _debug('vite:deps').enabled;
36709
36890
  const jsExtensionRE = /\.js$/i;
36710
36891
  const jsMapExtensionRE = /\.js\.map$/i;
@@ -36729,7 +36910,7 @@ ssr) {
36729
36910
  command: 'build'
36730
36911
  };
36731
36912
  const { root, logger } = config;
36732
- const log = asCommand ? logger.info : debug$d;
36913
+ const log = asCommand ? logger.info : debug$c;
36733
36914
  // Before Vite 2.9, dependencies were cached in the root of the cacheDir
36734
36915
  // For compat, we remove the cache if we find the old structure
36735
36916
  if (fs__default.existsSync(path__default.join(config.cacheDir, '_metadata.json'))) {
@@ -36907,7 +37088,7 @@ ssr) {
36907
37088
  exportsData = parse$f(entryContent);
36908
37089
  }
36909
37090
  catch {
36910
- debug$d(`Unable to parse dependency: ${id}. Trying again with a JSX transform.`);
37091
+ debug$c(`Unable to parse dependency: ${id}. Trying again with a JSX transform.`);
36911
37092
  const transformed = await transformWithEsbuild(entryContent, filePath, {
36912
37093
  loader: 'jsx'
36913
37094
  });
@@ -36983,7 +37164,7 @@ ssr) {
36983
37164
  !(currentInfo === null || currentInfo === void 0 ? void 0 : currentInfo.fileHash) ||
36984
37165
  (info === null || info === void 0 ? void 0 : info.fileHash) !== (currentInfo === null || currentInfo === void 0 ? void 0 : currentInfo.fileHash));
36985
37166
  });
36986
- debug$d(`optimized deps have altered files: ${alteredFiles}`);
37167
+ debug$c(`optimized deps have altered files: ${alteredFiles}`);
36987
37168
  }
36988
37169
  for (const o of Object.keys(meta.outputs)) {
36989
37170
  if (!o.match(jsMapExtensionRE)) {
@@ -37005,7 +37186,7 @@ ssr) {
37005
37186
  if (alteredFiles) {
37006
37187
  metadata.browserHash = newBrowserHash;
37007
37188
  }
37008
- debug$d(`deps bundled in ${(perf_hooks.performance.now() - start).toFixed(2)}ms`);
37189
+ debug$c(`deps bundled in ${(perf_hooks.performance.now() - start).toFixed(2)}ms`);
37009
37190
  return {
37010
37191
  alteredFiles,
37011
37192
  commit() {
@@ -37401,8 +37582,8 @@ function resolve(pkg, entry='.', options={}) {
37401
37582
  }
37402
37583
  }
37403
37584
 
37404
- const isDebug$7 = process.env.DEBUG;
37405
- const debug$c = createDebugger('vite:resolve-details', {
37585
+ const isDebug$5 = process.env.DEBUG;
37586
+ const debug$b = createDebugger('vite:resolve-details', {
37406
37587
  onlyWhenFocused: true
37407
37588
  });
37408
37589
  function invalidatePackageData(packageCache, pkgPath) {
@@ -37434,7 +37615,7 @@ function resolvePackageData(id, basedir, preserveSymlinks = false, packageCache)
37434
37615
  }
37435
37616
  catch (e) {
37436
37617
  if (e instanceof SyntaxError) {
37437
- isDebug$7 && debug$c(`Parsing failed: ${pkgPath}`);
37618
+ isDebug$5 && debug$b(`Parsing failed: ${pkgPath}`);
37438
37619
  }
37439
37620
  // Ignore error for missing package.json
37440
37621
  else if (e.code !== 'MODULE_NOT_FOUND') {
@@ -37524,8 +37705,8 @@ function watchPackageDataPlugin(config) {
37524
37705
  // special id for paths marked with browser: false
37525
37706
  // https://github.com/defunctzombie/package-browser-field-spec#ignore-a-module
37526
37707
  const browserExternalId = '__vite-browser-external';
37527
- const isDebug$6 = process.env.DEBUG;
37528
- const debug$b = createDebugger('vite:resolve-details', {
37708
+ const isDebug$4 = process.env.DEBUG;
37709
+ const debug$a = createDebugger('vite:resolve-details', {
37529
37710
  onlyWhenFocused: true
37530
37711
  });
37531
37712
  function resolvePlugin(baseOptions) {
@@ -37570,7 +37751,7 @@ function resolvePlugin(baseOptions) {
37570
37751
  if (asSrc && id.startsWith(FS_PREFIX)) {
37571
37752
  const fsPath = fsPathFromId(id);
37572
37753
  res = tryFsResolve(fsPath, options);
37573
- isDebug$6 && debug$b(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37754
+ isDebug$4 && debug$a(`[@fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37574
37755
  // always return here even if res doesn't exist since /@fs/ is explicit
37575
37756
  // if the file doesn't exist it should be a 404
37576
37757
  return res || fsPath;
@@ -37580,7 +37761,7 @@ function resolvePlugin(baseOptions) {
37580
37761
  if (asSrc && id.startsWith('/')) {
37581
37762
  const fsPath = path__default.resolve(root, id.slice(1));
37582
37763
  if ((res = tryFsResolve(fsPath, options))) {
37583
- isDebug$6 && debug$b(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37764
+ isDebug$4 && debug$a(`[url] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37584
37765
  return res;
37585
37766
  }
37586
37767
  }
@@ -37616,8 +37797,8 @@ function resolvePlugin(baseOptions) {
37616
37797
  return res;
37617
37798
  }
37618
37799
  if ((res = tryFsResolve(fsPath, options))) {
37619
- isDebug$6 &&
37620
- debug$b(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37800
+ isDebug$4 &&
37801
+ debug$a(`[relative] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37621
37802
  const pkg = importer != null && idToPkgMap.get(importer);
37622
37803
  if (pkg) {
37623
37804
  idToPkgMap.set(res, pkg);
@@ -37631,7 +37812,7 @@ function resolvePlugin(baseOptions) {
37631
37812
  }
37632
37813
  // absolute fs paths
37633
37814
  if (path__default.isAbsolute(id) && (res = tryFsResolve(id, options))) {
37634
- isDebug$6 && debug$b(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37815
+ isDebug$4 && debug$a(`[fs] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
37635
37816
  return res;
37636
37817
  }
37637
37818
  // external
@@ -37680,7 +37861,7 @@ function resolvePlugin(baseOptions) {
37680
37861
  }
37681
37862
  else {
37682
37863
  if (!asSrc) {
37683
- debug$b(`externalized node built-in "${id}" to empty module. ` +
37864
+ debug$a(`externalized node built-in "${id}" to empty module. ` +
37684
37865
  `(imported by: ${colors$1.white(colors$1.dim(importer))})`);
37685
37866
  }
37686
37867
  return isProduction
@@ -37689,7 +37870,7 @@ function resolvePlugin(baseOptions) {
37689
37870
  }
37690
37871
  }
37691
37872
  }
37692
- isDebug$6 && debug$b(`[fallthrough] ${colors$1.dim(id)}`);
37873
+ isDebug$4 && debug$a(`[fallthrough] ${colors$1.dim(id)}`);
37693
37874
  },
37694
37875
  load(id) {
37695
37876
  if (id.startsWith(browserExternalId)) {
@@ -38028,8 +38209,8 @@ function resolvePackageEntry(id, { dir, data, setResolvedCache, getResolvedCache
38028
38209
  const entryPointPath = path__default.join(dir, entry);
38029
38210
  const resolvedEntryPoint = tryFsResolve(entryPointPath, options);
38030
38211
  if (resolvedEntryPoint) {
38031
- isDebug$6 &&
38032
- debug$b(`[package entry] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedEntryPoint)}`);
38212
+ isDebug$4 &&
38213
+ debug$a(`[package entry] ${colors$1.cyan(id)} -> ${colors$1.dim(resolvedEntryPoint)}`);
38033
38214
  setResolvedCache('.', resolvedEntryPoint, targetWeb);
38034
38215
  return resolvedEntryPoint;
38035
38216
  }
@@ -38093,8 +38274,8 @@ function resolveDeepImport(id, { webResolvedImports, setResolvedCache, getResolv
38093
38274
  const resolved = tryFsResolve(path__default.join(dir, relativeId), options, !exportsField, // try index only if no exports field
38094
38275
  targetWeb);
38095
38276
  if (resolved) {
38096
- isDebug$6 &&
38097
- debug$b(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
38277
+ isDebug$4 &&
38278
+ debug$a(`[node/deep-import] ${colors$1.cyan(id)} -> ${colors$1.dim(resolved)}`);
38098
38279
  setResolvedCache(id, resolved, targetWeb);
38099
38280
  return resolved;
38100
38281
  }
@@ -38109,8 +38290,8 @@ function tryResolveBrowserMapping(id, importer, options, isFilePath) {
38109
38290
  if (browserMappedPath) {
38110
38291
  const fsPath = path__default.join(pkg.dir, browserMappedPath);
38111
38292
  if ((res = tryFsResolve(fsPath, options))) {
38112
- isDebug$6 &&
38113
- debug$b(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
38293
+ isDebug$4 &&
38294
+ debug$a(`[browser mapped] ${colors$1.cyan(id)} -> ${colors$1.dim(res)}`);
38114
38295
  idToPkgMap.set(res, pkg);
38115
38296
  return {
38116
38297
  id: res,
@@ -38153,7 +38334,7 @@ function getRealPath(resolved, preserveSymlinks) {
38153
38334
  return normalizePath$4(resolved);
38154
38335
  }
38155
38336
 
38156
- const debug$a = createDebugger('vite:ssr-external');
38337
+ const debug$9 = createDebugger('vite:ssr-external');
38157
38338
  /**
38158
38339
  * Converts "parent > child" syntax to just "child"
38159
38340
  */
@@ -38248,7 +38429,7 @@ function collectExternals(root, preserveSymlinks, ssrExternals, seen, logger) {
38248
38429
  }
38249
38430
  catch { }
38250
38431
  // resolve failed, assume include
38251
- debug$a(`Failed to resolve entries for package "${id}"\n`, e);
38432
+ debug$9(`Failed to resolve entries for package "${id}"\n`, e);
38252
38433
  continue;
38253
38434
  }
38254
38435
  // no esm entry but has require entry
@@ -38431,7 +38612,7 @@ function assetImportMetaUrlPlugin(config) {
38431
38612
  // target so we use the global location here. It can be
38432
38613
  // window.location or self.location in case it is used in a Web Worker.
38433
38614
  // @see https://developer.mozilla.org/en-US/docs/Web/API/Window/self
38434
- s.overwrite(index, index + exp.length, `new URL(import.meta.globEagerDefault(${JSON.stringify(pattern)})[${rawUrl}], self.location)`);
38615
+ s.overwrite(index, index + exp.length, `new URL(import.meta.globEagerDefault(${JSON.stringify(pattern)})[${rawUrl}], self.location)`, { contentOnly: true });
38435
38616
  continue;
38436
38617
  }
38437
38618
  }
@@ -38443,7 +38624,7 @@ function assetImportMetaUrlPlugin(config) {
38443
38624
  config.logger.warnOnce(`\n${exp} doesn't exist at build time, it will remain unchanged to be resolved at runtime`);
38444
38625
  return url;
38445
38626
  });
38446
- s.overwrite(index, index + exp.length, `new URL(${JSON.stringify(builtUrl)}, self.location)`);
38627
+ s.overwrite(index, index + exp.length, `new URL(${JSON.stringify(builtUrl)}, self.location)`, { contentOnly: true });
38447
38628
  }
38448
38629
  if (s) {
38449
38630
  return {
@@ -38939,7 +39120,7 @@ var src = {exports: {}};
38939
39120
 
38940
39121
  var browser = {exports: {}};
38941
39122
 
38942
- var debug$9 = {exports: {}};
39123
+ var debug$8 = {exports: {}};
38943
39124
 
38944
39125
  /**
38945
39126
  * Helpers.
@@ -39296,7 +39477,7 @@ function coerce(val) {
39296
39477
  if (val instanceof Error) return val.stack || val.message;
39297
39478
  return val;
39298
39479
  }
39299
- }(debug$9, debug$9.exports));
39480
+ }(debug$8, debug$8.exports));
39300
39481
 
39301
39482
  /**
39302
39483
  * This is the web browser implementation of `debug()`.
@@ -39305,7 +39486,7 @@ function coerce(val) {
39305
39486
  */
39306
39487
 
39307
39488
  (function (module, exports) {
39308
- exports = module.exports = debug$9.exports;
39489
+ exports = module.exports = debug$8.exports;
39309
39490
  exports.log = log;
39310
39491
  exports.formatArgs = formatArgs;
39311
39492
  exports.save = save;
@@ -39502,7 +39683,7 @@ var util = require$$0__default$1;
39502
39683
  * Expose `debug()` as the module.
39503
39684
  */
39504
39685
 
39505
- exports = module.exports = debug$9.exports;
39686
+ exports = module.exports = debug$8.exports;
39506
39687
  exports.init = init;
39507
39688
  exports.log = log;
39508
39689
  exports.formatArgs = formatArgs;
@@ -40592,7 +40773,7 @@ function unpipe$1(stream) {
40592
40773
  * @private
40593
40774
  */
40594
40775
 
40595
- var debug$8 = src.exports('finalhandler');
40776
+ var debug$7 = src.exports('finalhandler');
40596
40777
  var encodeUrl = encodeurl;
40597
40778
  var escapeHtml = escapeHtml_1;
40598
40779
  var onFinished = onFinished$2.exports;
@@ -40671,7 +40852,7 @@ function finalhandler$1 (req, res, options) {
40671
40852
 
40672
40853
  // ignore 404 on in-flight response
40673
40854
  if (!err && headersSent(res)) {
40674
- debug$8('cannot 404 after headers sent');
40855
+ debug$7('cannot 404 after headers sent');
40675
40856
  return
40676
40857
  }
40677
40858
 
@@ -40696,7 +40877,7 @@ function finalhandler$1 (req, res, options) {
40696
40877
  msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req));
40697
40878
  }
40698
40879
 
40699
- debug$8('default %s', status);
40880
+ debug$7('default %s', status);
40700
40881
 
40701
40882
  // schedule onerror callback
40702
40883
  if (err && onerror) {
@@ -40705,7 +40886,7 @@ function finalhandler$1 (req, res, options) {
40705
40886
 
40706
40887
  // cannot actually respond
40707
40888
  if (headersSent(res)) {
40708
- debug$8('cannot %d after headers sent', status);
40889
+ debug$7('cannot %d after headers sent', status);
40709
40890
  req.socket.destroy();
40710
40891
  return
40711
40892
  }
@@ -40952,7 +41133,7 @@ module.exports = function(a, b){
40952
41133
  * @private
40953
41134
  */
40954
41135
 
40955
- var debug$7 = src.exports('connect:dispatcher');
41136
+ var debug$6 = src.exports('connect:dispatcher');
40956
41137
  var EventEmitter$3 = require$$0__default$3.EventEmitter;
40957
41138
  var finalhandler = finalhandler_1;
40958
41139
  var http$4 = require$$1__default$2;
@@ -41042,7 +41223,7 @@ proto.use = function use(route, fn) {
41042
41223
  }
41043
41224
 
41044
41225
  // add the middleware
41045
- debug$7('use %s %s', path || '/', handle.name || 'anonymous');
41226
+ debug$6('use %s %s', path || '/', handle.name || 'anonymous');
41046
41227
  this.stack.push({ route: path, handle: handle });
41047
41228
 
41048
41229
  return this;
@@ -41166,7 +41347,7 @@ function call(handle, route, err, req, res, next) {
41166
41347
  var error = err;
41167
41348
  var hasError = Boolean(err);
41168
41349
 
41169
- debug$7('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
41350
+ debug$6('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
41170
41351
 
41171
41352
  try {
41172
41353
  if (hasError && arity === 4) {
@@ -44660,7 +44841,7 @@ async function getCertificate(cacheDir) {
44660
44841
  return content;
44661
44842
  }
44662
44843
  catch {
44663
- const content = (await Promise.resolve().then(function () { return require('./dep-dd016db2.js'); })).createCertificate();
44844
+ const content = (await Promise.resolve().then(function () { return require('./dep-00d6c1ad.js'); })).createCertificate();
44664
44845
  fs$n.promises
44665
44846
  .mkdir(cacheDir, { recursive: true })
44666
44847
  .then(() => fs$n.promises.writeFile(cachePath, content))
@@ -49820,20 +50001,20 @@ var webOutgoing = { // <--
49820
50001
 
49821
50002
  var followRedirects$1 = {exports: {}};
49822
50003
 
49823
- var debug$6;
50004
+ var debug$5;
49824
50005
 
49825
50006
  var debug_1 = function () {
49826
- if (!debug$6) {
50007
+ if (!debug$5) {
49827
50008
  try {
49828
50009
  /* eslint global-require: off */
49829
- debug$6 = require("debug")("follow-redirects");
50010
+ debug$5 = require("debug")("follow-redirects");
49830
50011
  }
49831
50012
  catch (error) { /* */ }
49832
- if (typeof debug$6 !== "function") {
49833
- debug$6 = function () { /* */ };
50013
+ if (typeof debug$5 !== "function") {
50014
+ debug$5 = function () { /* */ };
49834
50015
  }
49835
50016
  }
49836
- debug$6.apply(null, arguments);
50017
+ debug$5.apply(null, arguments);
49837
50018
  };
49838
50019
 
49839
50020
  var url$1 = require$$0__default$5;
@@ -49842,7 +50023,7 @@ var http$1 = require$$1__default$2;
49842
50023
  var https$1 = require$$1__default$4;
49843
50024
  var Writable = require$$0__default$2.Writable;
49844
50025
  var assert = require$$5__default;
49845
- var debug$5 = debug_1;
50026
+ var debug$4 = debug_1;
49846
50027
 
49847
50028
  // Create handlers that pass events from native requests
49848
50029
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
@@ -50225,7 +50406,7 @@ RedirectableRequest.prototype._processResponse = function (response) {
50225
50406
  }
50226
50407
 
50227
50408
  // Create the redirected request
50228
- debug$5("redirecting to", redirectUrl);
50409
+ debug$4("redirecting to", redirectUrl);
50229
50410
  this._isRedirect = true;
50230
50411
  var redirectUrlParts = url$1.parse(redirectUrl);
50231
50412
  Object.assign(this._options, redirectUrlParts);
@@ -50316,7 +50497,7 @@ function wrap(protocols) {
50316
50497
  options.nativeProtocols = nativeProtocols;
50317
50498
 
50318
50499
  assert.equal(options.protocol, protocol, "protocol mismatch");
50319
- debug$5("options", options);
50500
+ debug$4("options", options);
50320
50501
  return new RedirectableRequest(options, callback);
50321
50502
  }
50322
50503
 
@@ -51031,7 +51212,7 @@ var httpProxy$1 = ProxyServer;
51031
51212
 
51032
51213
  var httpProxy = httpProxy$1;
51033
51214
 
51034
- const debug$4 = createDebugger('vite:proxy');
51215
+ const debug$3 = createDebugger('vite:proxy');
51035
51216
  function proxyMiddleware(httpServer, config) {
51036
51217
  const options = config.server.proxy;
51037
51218
  // lazy require only when proxy is used
@@ -51066,7 +51247,7 @@ function proxyMiddleware(httpServer, config) {
51066
51247
  if (opts.rewrite) {
51067
51248
  req.url = opts.rewrite(url);
51068
51249
  }
51069
- debug$4(`${req.url} -> ws ${opts.target}`);
51250
+ debug$3(`${req.url} -> ws ${opts.target}`);
51070
51251
  proxy.ws(req, socket, head);
51071
51252
  return;
51072
51253
  }
@@ -51085,20 +51266,20 @@ function proxyMiddleware(httpServer, config) {
51085
51266
  const bypassResult = opts.bypass(req, res, opts);
51086
51267
  if (typeof bypassResult === 'string') {
51087
51268
  req.url = bypassResult;
51088
- debug$4(`bypass: ${req.url} -> ${bypassResult}`);
51269
+ debug$3(`bypass: ${req.url} -> ${bypassResult}`);
51089
51270
  return next();
51090
51271
  }
51091
51272
  else if (isObject$4(bypassResult)) {
51092
51273
  Object.assign(options, bypassResult);
51093
- debug$4(`bypass: ${req.url} use modified options: %O`, options);
51274
+ debug$3(`bypass: ${req.url} use modified options: %O`, options);
51094
51275
  return next();
51095
51276
  }
51096
51277
  else if (bypassResult === false) {
51097
- debug$4(`bypass: ${req.url} -> 404`);
51278
+ debug$3(`bypass: ${req.url} -> 404`);
51098
51279
  return res.end(404);
51099
51280
  }
51100
51281
  }
51101
- debug$4(`${req.url} -> ${opts.target || opts.forward}`);
51282
+ debug$3(`${req.url} -> ${opts.target || opts.forward}`);
51102
51283
  if (opts.rewrite) {
51103
51284
  req.url = opts.rewrite(req.url);
51104
51285
  }
@@ -51395,7 +51576,6 @@ function stattag (stat) {
51395
51576
  return '"' + size + '-' + mtime + '"'
51396
51577
  }
51397
51578
 
51398
- const isDebug$5 = process.env.DEBUG;
51399
51579
  const alias$1 = {
51400
51580
  js: 'application/javascript',
51401
51581
  css: 'text/css',
@@ -51422,21 +51602,14 @@ function send$1(req, res, content, type, options) {
51422
51602
  }
51423
51603
  // inject source map reference
51424
51604
  if (map && map.mappings) {
51425
- if (isDebug$5) {
51426
- content += `\n/*${JSON.stringify(map, null, 2).replace(/\*\//g, '*\\/')}*/\n`;
51605
+ if (type === 'js' || type === 'css') {
51606
+ content = getCodeWithSourcemap(type, content.toString(), map);
51427
51607
  }
51428
- content += genSourceMapString(map);
51429
51608
  }
51430
51609
  res.statusCode = 200;
51431
51610
  res.end(content);
51432
51611
  return;
51433
51612
  }
51434
- function genSourceMapString(map) {
51435
- if (typeof map !== 'string') {
51436
- map = JSON.stringify(map);
51437
- }
51438
- return `\n//# sourceMappingURL=data:application/json;base64,${Buffer.from(map).toString('base64')}`;
51439
- }
51440
51613
 
51441
51614
  var convertSourceMap = {};
51442
51615
 
@@ -51826,7 +51999,7 @@ async function ssrTransform(code, inMap, url) {
51826
51999
  }
51827
52000
  else {
51828
52001
  // anonymous default exports
51829
- s.overwrite(node.start, node.start + 14 /* 'export default'.length */, `${ssrModuleExportsKey}.default =`);
52002
+ s.overwrite(node.start, node.start + 14 /* 'export default'.length */, `${ssrModuleExportsKey}.default =`, { contentOnly: true });
51830
52003
  }
51831
52004
  }
51832
52005
  // export * from './foo'
@@ -51871,14 +52044,16 @@ async function ssrTransform(code, inMap, url) {
51871
52044
  }
51872
52045
  }
51873
52046
  else {
51874
- s.overwrite(id.start, id.end, binding);
52047
+ s.overwrite(id.start, id.end, binding, { contentOnly: true });
51875
52048
  }
51876
52049
  },
51877
52050
  onImportMeta(node) {
51878
- s.overwrite(node.start, node.end, ssrImportMetaKey);
52051
+ s.overwrite(node.start, node.end, ssrImportMetaKey, { contentOnly: true });
51879
52052
  },
51880
52053
  onDynamicImport(node) {
51881
- s.overwrite(node.start, node.start + 6, ssrDynamicImportKey);
52054
+ s.overwrite(node.start, node.start + 6, ssrDynamicImportKey, {
52055
+ contentOnly: true
52056
+ });
51882
52057
  if (node.type === 'ImportExpression' && node.source.type === 'Literal') {
51883
52058
  dynamicDeps.add(node.source.value);
51884
52059
  }
@@ -52104,44 +52279,6 @@ function isInDestructuringAssignment(parent, parentStack) {
52104
52279
  return false;
52105
52280
  }
52106
52281
 
52107
- const isDebug$4 = !!process.env.DEBUG;
52108
- const debug$3 = createDebugger('vite:sourcemap', {
52109
- onlyWhenFocused: true
52110
- });
52111
- // Virtual modules should be prefixed with a null byte to avoid a
52112
- // false positive "missing source" warning. We also check for certain
52113
- // prefixes used for special handling in esbuildDepPlugin.
52114
- const virtualSourceRE = /^(\0|dep:|browser-external:)/;
52115
- async function injectSourcesContent(map, file, logger) {
52116
- let sourceRoot;
52117
- try {
52118
- // The source root is undefined for virtual modules and permission errors.
52119
- sourceRoot = await fs$n.promises.realpath(path__default.resolve(path__default.dirname(file), map.sourceRoot || ''));
52120
- }
52121
- catch { }
52122
- const missingSources = [];
52123
- map.sourcesContent = await Promise.all(map.sources.map((sourcePath) => {
52124
- if (sourcePath && !virtualSourceRE.test(sourcePath)) {
52125
- sourcePath = decodeURI(sourcePath);
52126
- if (sourceRoot) {
52127
- sourcePath = path__default.resolve(sourceRoot, sourcePath);
52128
- }
52129
- return fs$n.promises.readFile(sourcePath, 'utf-8').catch(() => {
52130
- missingSources.push(sourcePath);
52131
- return null;
52132
- });
52133
- }
52134
- return null;
52135
- }));
52136
- // Use this command…
52137
- // DEBUG="vite:sourcemap" vite build
52138
- // …to log the missing sources.
52139
- if (missingSources.length) {
52140
- logger.warnOnce(`Sourcemap for "${file}" points to missing source files`);
52141
- isDebug$4 && debug$3(`Missing sources:\n ` + missingSources.join(`\n `));
52142
- }
52143
- }
52144
-
52145
52282
  function totalist(dir, callback, pre='') {
52146
52283
  dir = path$p.resolve('.', dir);
52147
52284
  let arr = fs$n.readdirSync(dir);
@@ -52976,7 +53113,7 @@ const processNodeUrl = (node, s, config, htmlPath, originalUrl, moduleGraph) =>
52976
53113
  }
52977
53114
  if (startsWithSingleSlashRE.test(url)) {
52978
53115
  // prefix with base
52979
- s.overwrite(node.value.loc.start.offset, node.value.loc.end.offset, `"${config.base + url.slice(1)}"`);
53116
+ s.overwrite(node.value.loc.start.offset, node.value.loc.end.offset, `"${config.base + url.slice(1)}"`, { contentOnly: true });
52980
53117
  }
52981
53118
  else if (url.startsWith('.') &&
52982
53119
  originalUrl &&
@@ -52986,7 +53123,7 @@ const processNodeUrl = (node, s, config, htmlPath, originalUrl, moduleGraph) =>
52986
53123
  // path will add `/a/` prefix, it will caused 404.
52987
53124
  // rewrite before `./index.js` -> `localhost:3000/a/index.js`.
52988
53125
  // rewrite after `../index.js` -> `localhost:3000/index.js`.
52989
- s.overwrite(node.value.loc.start.offset, node.value.loc.end.offset, `"${path__default.posix.join(path__default.posix.relative(originalUrl, '/'), url.slice(1))}"`);
53126
+ s.overwrite(node.value.loc.start.offset, node.value.loc.end.offset, `"${path__default.posix.join(path__default.posix.relative(originalUrl, '/'), url.slice(1))}"`, { contentOnly: true });
52990
53127
  }
52991
53128
  };
52992
53129
  const devHtmlHook = async (html, { path: htmlPath, server, originalUrl }) => {
@@ -53010,7 +53147,7 @@ const devHtmlHook = async (html, { path: htmlPath, server, originalUrl }) => {
53010
53147
  if (module) {
53011
53148
  server === null || server === void 0 ? void 0 : server.moduleGraph.invalidateModule(module);
53012
53149
  }
53013
- s.overwrite(node.loc.start.offset, node.loc.end.offset, `<script type="module" src="${modulePath}"></script>`);
53150
+ s.overwrite(node.loc.start.offset, node.loc.end.offset, `<script type="module" src="${modulePath}"></script>`, { contentOnly: true });
53014
53151
  };
53015
53152
  await traverseHtml(html, htmlPath, (node) => {
53016
53153
  if (node.type !== 1 /* ELEMENT */) {
@@ -53276,7 +53413,7 @@ async function handleHMRUpdate(file, server) {
53276
53413
  const { ws, config, moduleGraph } = server;
53277
53414
  const shortFile = getShortName(file, config.root);
53278
53415
  const isConfig = file === config.configFile;
53279
- const isConfigDependency = config.configFileDependencies.some((name) => file === path__default.resolve(name));
53416
+ const isConfigDependency = config.configFileDependencies.some((name) => file === name);
53280
53417
  const isEnv = config.inlineConfig.envFile !== false &&
53281
53418
  (file === '.env' || file.startsWith('.env.'));
53282
53419
  if (isConfig || isConfigDependency || isEnv) {
@@ -56825,7 +56962,7 @@ function importAnalysisPlugin(config) {
56825
56962
  // e.g. `import.meta.glob('glob:./dir/*.js')`
56826
56963
  const { imports, importsString, exp, endIndex, base, pattern, isEager } = await transformImportGlob(source, start, importer, index, root, config.logger, normalizeUrl, resolve);
56827
56964
  str().prepend(importsString);
56828
- str().overwrite(expStart, endIndex, exp);
56965
+ str().overwrite(expStart, endIndex, exp, { contentOnly: true });
56829
56966
  imports.forEach((url) => {
56830
56967
  url = url.replace(base, '/');
56831
56968
  importedUrls.add(url);
@@ -56904,24 +57041,26 @@ function importAnalysisPlugin(config) {
56904
57041
  debug$1(`${url} needs interop`);
56905
57042
  if (isDynamicImport) {
56906
57043
  // rewrite `import('package')` to expose the default directly
56907
- str().overwrite(expStart, expEnd, `import('${url}').then(m => m.default && m.default.__esModule ? m.default : ({ ...m.default, default: m.default }))`);
57044
+ str().overwrite(expStart, expEnd, `import('${url}').then(m => m.default && m.default.__esModule ? m.default : ({ ...m.default, default: m.default }))`, { contentOnly: true });
56908
57045
  }
56909
57046
  else {
56910
57047
  const exp = source.slice(expStart, expEnd);
56911
57048
  const rewritten = transformCjsImport(exp, url, rawUrl, index);
56912
57049
  if (rewritten) {
56913
- str().overwrite(expStart, expEnd, rewritten);
57050
+ str().overwrite(expStart, expEnd, rewritten, {
57051
+ contentOnly: true
57052
+ });
56914
57053
  }
56915
57054
  else {
56916
57055
  // #1439 export * from '...'
56917
- str().overwrite(start, end, url);
57056
+ str().overwrite(start, end, url, { contentOnly: true });
56918
57057
  }
56919
57058
  }
56920
57059
  rewriteDone = true;
56921
57060
  }
56922
57061
  }
56923
57062
  if (!rewriteDone) {
56924
- str().overwrite(start, end, isDynamicImport ? `'${url}'` : url);
57063
+ str().overwrite(start, end, isDynamicImport ? `'${url}'` : url, { contentOnly: true });
56925
57064
  }
56926
57065
  });
56927
57066
  }
@@ -56954,7 +57093,7 @@ function importAnalysisPlugin(config) {
56954
57093
  if (!/^('.*'|".*"|`.*`)$/.test(url) ||
56955
57094
  isExplicitImportRequired(url.slice(1, -1))) {
56956
57095
  needQueryInjectHelper = true;
56957
- str().overwrite(start, end, `__vite__injectQuery(${url}, 'import')`);
57096
+ str().overwrite(start, end, `__vite__injectQuery(${url}, 'import')`, { contentOnly: true });
56958
57097
  }
56959
57098
  }
56960
57099
  }
@@ -56991,7 +57130,9 @@ function importAnalysisPlugin(config) {
56991
57130
  for (const { url, start, end } of acceptedUrls) {
56992
57131
  const [normalized] = await moduleGraph.resolveUrl(toAbsoluteUrl(markExplicitImport(url)), ssr);
56993
57132
  normalizedAcceptedUrls.add(normalized);
56994
- str().overwrite(start, end, JSON.stringify(normalized));
57133
+ str().overwrite(start, end, JSON.stringify(normalized), {
57134
+ contentOnly: true
57135
+ });
56995
57136
  }
56996
57137
  // update the module graph for HMR analysis.
56997
57138
  // node CSS imports does its own graph update in the css plugin so we
@@ -57497,7 +57638,7 @@ function definePlugin(config) {
57497
57638
  const start = match.index;
57498
57639
  const end = start + match[0].length;
57499
57640
  const replacement = '' + replacements[match[1]];
57500
- s.overwrite(start, end, replacement);
57641
+ s.overwrite(start, end, replacement, { contentOnly: true });
57501
57642
  }
57502
57643
  if (!hasReplaced) {
57503
57644
  return null;
@@ -57618,7 +57759,9 @@ function workerImportMetaUrlPlugin(config) {
57618
57759
  url = injectQuery(url, WORKER_FILE_ID);
57619
57760
  url = injectQuery(url, `type=${workerType}`);
57620
57761
  }
57621
- s.overwrite(urlIndex, urlIndex + exp.length, JSON.stringify(url));
57762
+ s.overwrite(urlIndex, urlIndex + exp.length, JSON.stringify(url), {
57763
+ contentOnly: true
57764
+ });
57622
57765
  }
57623
57766
  if (s) {
57624
57767
  return {
@@ -58053,7 +58196,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development')
58053
58196
  const resolved = {
58054
58197
  ...config,
58055
58198
  configFile: configFile ? normalizePath$4(configFile) : undefined,
58056
- configFileDependencies,
58199
+ configFileDependencies: configFileDependencies.map((name) => normalizePath$4(path__default.resolve(name))),
58057
58200
  inlineConfig,
58058
58201
  root: resolvedRoot,
58059
58202
  base: BASE_URL,
@@ -58536,6 +58679,7 @@ exports.commonjsGlobal = commonjsGlobal;
58536
58679
  exports.createLogger = createLogger;
58537
58680
  exports.createServer = createServer;
58538
58681
  exports.defineConfig = defineConfig;
58682
+ exports.formatPostcssSourceMap = formatPostcssSourceMap;
58539
58683
  exports.getAugmentedNamespace = getAugmentedNamespace;
58540
58684
  exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
58541
58685
  exports.index = index$1;