vite 5.2.7 → 5.2.9

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.
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-C-KAszbv.js';
5
+ import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-_QLjGPdL.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -757,7 +757,7 @@ cli
757
757
  filterDuplicateOptions(options);
758
758
  // output structure is preserved even after bundling so require()
759
759
  // is ok here
760
- const { createServer } = await import('./chunks/dep-C-KAszbv.js').then(function (n) { return n.E; });
760
+ const { createServer } = await import('./chunks/dep-_QLjGPdL.js').then(function (n) { return n.E; });
761
761
  try {
762
762
  const server = await createServer({
763
763
  root,
@@ -836,7 +836,7 @@ cli
836
836
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
837
837
  .action(async (root, options) => {
838
838
  filterDuplicateOptions(options);
839
- const { build } = await import('./chunks/dep-C-KAszbv.js').then(function (n) { return n.F; });
839
+ const { build } = await import('./chunks/dep-_QLjGPdL.js').then(function (n) { return n.F; });
840
840
  const buildOptions = cleanOptions(options);
841
841
  try {
842
842
  await build({
@@ -863,7 +863,7 @@ cli
863
863
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
864
864
  .action(async (root, options) => {
865
865
  filterDuplicateOptions(options);
866
- const { optimizeDeps } = await import('./chunks/dep-C-KAszbv.js').then(function (n) { return n.D; });
866
+ const { optimizeDeps } = await import('./chunks/dep-_QLjGPdL.js').then(function (n) { return n.D; });
867
867
  try {
868
868
  const config = await resolveConfig({
869
869
  root,
@@ -889,7 +889,7 @@ cli
889
889
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
890
890
  .action(async (root, options) => {
891
891
  filterDuplicateOptions(options);
892
- const { preview } = await import('./chunks/dep-C-KAszbv.js').then(function (n) { return n.G; });
892
+ const { preview } = await import('./chunks/dep-_QLjGPdL.js').then(function (n) { return n.G; });
893
893
  try {
894
894
  const server = await preview({
895
895
  root,
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-C-KAszbv.js';
3
- export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-C-KAszbv.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-_QLjGPdL.js';
3
+ export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-_QLjGPdL.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  import { existsSync, readFileSync } from 'node:fs';
@@ -5241,21 +5241,29 @@ class MagicString {
5241
5241
  if (searchValue.global) {
5242
5242
  const matches = matchAll(searchValue, this.original);
5243
5243
  matches.forEach((match) => {
5244
- if (match.index != null)
5244
+ if (match.index != null) {
5245
+ const replacement = getReplacement(match, this.original);
5246
+ if (replacement !== match[0]) {
5247
+ this.overwrite(
5248
+ match.index,
5249
+ match.index + match[0].length,
5250
+ replacement
5251
+ );
5252
+ }
5253
+ }
5254
+ });
5255
+ } else {
5256
+ const match = this.original.match(searchValue);
5257
+ if (match && match.index != null) {
5258
+ const replacement = getReplacement(match, this.original);
5259
+ if (replacement !== match[0]) {
5245
5260
  this.overwrite(
5246
5261
  match.index,
5247
5262
  match.index + match[0].length,
5248
- getReplacement(match, this.original),
5263
+ replacement
5249
5264
  );
5250
- });
5251
- } else {
5252
- const match = this.original.match(searchValue);
5253
- if (match && match.index != null)
5254
- this.overwrite(
5255
- match.index,
5256
- match.index + match[0].length,
5257
- getReplacement(match, this.original),
5258
- );
5265
+ }
5266
+ }
5259
5267
  }
5260
5268
  return this;
5261
5269
  }
@@ -5287,7 +5295,9 @@ class MagicString {
5287
5295
  index !== -1;
5288
5296
  index = original.indexOf(string, index + stringLength)
5289
5297
  ) {
5290
- this.overwrite(index, index + stringLength, replacement);
5298
+ const previous = original.slice(index, index + stringLength);
5299
+ if (previous !== replacement)
5300
+ this.overwrite(index, index + stringLength, replacement);
5291
5301
  }
5292
5302
 
5293
5303
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.2.7",
3
+ "version": "5.2.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -81,7 +81,7 @@
81
81
  },
82
82
  "devDependencies": {
83
83
  "@ampproject/remapping": "^2.3.0",
84
- "@babel/parser": "^7.24.1",
84
+ "@babel/parser": "^7.24.4",
85
85
  "@jridgewell/trace-mapping": "^0.3.25",
86
86
  "@polka/compression": "^1.0.0-next.25",
87
87
  "@rollup/plugin-alias": "^5.1.0",
@@ -114,7 +114,7 @@
114
114
  "http-proxy": "^1.18.1",
115
115
  "launch-editor-middleware": "^2.6.1",
116
116
  "lightningcss": "^1.24.1",
117
- "magic-string": "^0.30.8",
117
+ "magic-string": "^0.30.9",
118
118
  "micromatch": "^4.0.5",
119
119
  "mlly": "^1.6.1",
120
120
  "mrmime": "^2.0.0",
@@ -131,10 +131,11 @@
131
131
  "rollup-plugin-dts": "^6.1.0",
132
132
  "rollup-plugin-esbuild": "^6.1.1",
133
133
  "rollup-plugin-license": "^3.3.1",
134
+ "sass": "^1.74.1",
134
135
  "sirv": "^2.0.4",
135
136
  "source-map-support": "^0.5.21",
136
137
  "strip-ansi": "^7.1.0",
137
- "strip-literal": "^2.0.0",
138
+ "strip-literal": "^2.1.0",
138
139
  "tsconfck": "^3.0.3",
139
140
  "tslib": "^2.6.2",
140
141
  "types": "link:./types",