vite 4.5.9 → 4.5.11

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.
@@ -16068,8 +16068,8 @@ class MagicString {
16068
16068
  }
16069
16069
 
16070
16070
  const assetUrlRE = /__VITE_ASSET__([a-z\d]+)__(?:\$_(.*?)__)?/g;
16071
- const rawRE = /(?:\?|&)raw(?:&|$)/;
16072
- const urlRE = /(\?|&)url(?:&|$)/;
16071
+ const rawRE$1 = /(?:\?|&)raw(?:&|$)/;
16072
+ const urlRE$1 = /(\?|&)url(?:&|$)/;
16073
16073
  const jsSourceMapRE = /\.[cm]?js\.map$/;
16074
16074
  const unnededFinalQueryCharRE = /[?&]$/;
16075
16075
  const assetCache = new WeakMap();
@@ -16136,7 +16136,7 @@ function assetPlugin(config) {
16136
16136
  generatedAssets.set(config, new Map());
16137
16137
  },
16138
16138
  resolveId(id) {
16139
- if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) {
16139
+ if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
16140
16140
  return;
16141
16141
  }
16142
16142
  // imports to absolute urls pointing to files in /public
@@ -16153,15 +16153,15 @@ function assetPlugin(config) {
16153
16153
  return;
16154
16154
  }
16155
16155
  // raw requests, read from disk
16156
- if (rawRE.test(id)) {
16156
+ if (rawRE$1.test(id)) {
16157
16157
  const file = checkPublicFile(id, config) || cleanUrl(id);
16158
16158
  // raw query, read file and return as string
16159
16159
  return `export default ${JSON.stringify(await fsp.readFile(file, 'utf-8'))}`;
16160
16160
  }
16161
- if (!config.assetsInclude(cleanUrl(id)) && !urlRE.test(id)) {
16161
+ if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
16162
16162
  return;
16163
16163
  }
16164
- id = id.replace(urlRE, '$1').replace(unnededFinalQueryCharRE, '');
16164
+ id = id.replace(urlRE$1, '$1').replace(unnededFinalQueryCharRE, '');
16165
16165
  const url = await fileToUrl(id, config, this);
16166
16166
  return `export default ${JSON.stringify(url)}`;
16167
16167
  },
@@ -38224,7 +38224,7 @@ const cssModuleRE = new RegExp(`\\.module${CSS_LANGS_RE.source}`);
38224
38224
  const directRequestRE = /[?&]direct\b/;
38225
38225
  const htmlProxyRE = /[?&]html-proxy\b/;
38226
38226
  const commonjsProxyRE = /\?commonjs-proxy/;
38227
- const inlineRE = /[?&]inline\b/;
38227
+ const inlineRE$1 = /[?&]inline\b/;
38228
38228
  const inlineCSSRE = /[?&]inline-css\b/;
38229
38229
  const styleAttrRE = /[?&]style-attr\b/;
38230
38230
  const usedRE = /[?&]used\b/;
@@ -38315,7 +38315,7 @@ function cssPlugin(config) {
38315
38315
  const thisModule = moduleGraph.getModuleById(id);
38316
38316
  if (thisModule) {
38317
38317
  // CSS modules cannot self-accept since it exports values
38318
- const isSelfAccepting = !modules && !inlineRE.test(id) && !htmlProxyRE.test(id);
38318
+ const isSelfAccepting = !modules && !inlineRE$1.test(id) && !htmlProxyRE.test(id);
38319
38319
  if (deps) {
38320
38320
  // record deps in the module graph so edits to @import css can trigger
38321
38321
  // main import to hot update
@@ -38394,7 +38394,7 @@ function cssPostPlugin(config) {
38394
38394
  return;
38395
38395
  }
38396
38396
  css = stripBomTag(css);
38397
- const inlined = inlineRE.test(id);
38397
+ const inlined = inlineRE$1.test(id);
38398
38398
  const modules = cssModulesCache.get(config).get(id);
38399
38399
  // #6984, #7552
38400
38400
  // `foo.module.css` => modulesCode
@@ -38995,8 +38995,8 @@ function createCachedImport(imp) {
38995
38995
  return cached;
38996
38996
  };
38997
38997
  }
38998
- const importPostcssImport = createCachedImport(() => import('./dep-8defca0d.js').then(function (n) { return n.i; }));
38999
- const importPostcssModules = createCachedImport(() => import('./dep-4e2b6ecb.js').then(function (n) { return n.i; }));
38998
+ const importPostcssImport = createCachedImport(() => import('./dep-d570726f.js').then(function (n) { return n.i; }));
38999
+ const importPostcssModules = createCachedImport(() => import('./dep-65a29f02.js').then(function (n) { return n.i; }));
39000
39000
  const importPostcss = createCachedImport(() => import('postcss'));
39001
39001
  /**
39002
39002
  * @experimental
@@ -41988,7 +41988,7 @@ function importAnalysisPlugin(config) {
41988
41988
  // warn imports to non-asset /public files
41989
41989
  if (specifier[0] === '/' &&
41990
41990
  !(config.assetsInclude(cleanUrl(specifier)) ||
41991
- urlRE.test(specifier)) &&
41991
+ urlRE$1.test(specifier)) &&
41992
41992
  checkPublicFile(specifier, config)) {
41993
41993
  throw new Error(`Cannot import non-asset file ${specifier} which is inside /public. ` +
41994
41994
  `JS/CSS files inside /public are copied as-is on build and ` +
@@ -64489,6 +64489,11 @@ function htmlFallbackMiddleware(root, spaFallback) {
64489
64489
 
64490
64490
  const debugCache = createDebugger('vite:cache');
64491
64491
  const knownIgnoreList = new Set(['/', '/favicon.ico']);
64492
+ const trailingQuerySeparatorsRE = /[?&]+$/;
64493
+ // TODO: consolidate this regex pattern with the url, raw, and inline checks in plugins
64494
+ const urlRE = /[?&]url\b/;
64495
+ const rawRE = /[?&]raw\b/;
64496
+ const inlineRE = /[?&]inline\b/;
64492
64497
  function transformMiddleware(server) {
64493
64498
  const { config: { root, logger }, moduleGraph, } = server;
64494
64499
  // Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
@@ -64584,8 +64589,11 @@ function transformMiddleware(server) {
64584
64589
  logger.warn(colors$1.yellow(warning));
64585
64590
  }
64586
64591
  }
64587
- if ((rawRE.test(url) || urlRE.test(url)) &&
64588
- !ensureServingAccess(url, server, res, next)) {
64592
+ const urlWithoutTrailingQuerySeparators = url.replace(trailingQuerySeparatorsRE, '');
64593
+ if ((rawRE.test(urlWithoutTrailingQuerySeparators) ||
64594
+ urlRE.test(urlWithoutTrailingQuerySeparators) ||
64595
+ inlineRE.test(urlWithoutTrailingQuerySeparators)) &&
64596
+ !ensureServingAccess(urlWithoutTrailingQuerySeparators, server, res, next)) {
64589
64597
  return;
64590
64598
  }
64591
64599
  if (isJSRequest(url) ||
@@ -1,4 +1,4 @@
1
- import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-3936e161.js';
1
+ import { F as commonjsGlobal, E as getDefaultExportFromCjs } from './dep-4f6e688c.js';
2
2
  import require$$0__default from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -1,4 +1,4 @@
1
- import { E as getDefaultExportFromCjs } from './dep-3936e161.js';
1
+ import { E as getDefaultExportFromCjs } from './dep-4f6e688c.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-c423598f.js';
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 { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-3936e161.js';
5
+ import { C as colors, D as bindShortcuts, x as createLogger, h as resolveConfig } from './chunks/dep-4f6e688c.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -759,7 +759,7 @@ cli
759
759
  filterDuplicateOptions(options);
760
760
  // output structure is preserved even after bundling so require()
761
761
  // is ok here
762
- const { createServer } = await import('./chunks/dep-3936e161.js').then(function (n) { return n.I; });
762
+ const { createServer } = await import('./chunks/dep-4f6e688c.js').then(function (n) { return n.I; });
763
763
  try {
764
764
  const server = await createServer({
765
765
  root,
@@ -837,7 +837,7 @@ cli
837
837
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
838
838
  .action(async (root, options) => {
839
839
  filterDuplicateOptions(options);
840
- const { build } = await import('./chunks/dep-3936e161.js').then(function (n) { return n.H; });
840
+ const { build } = await import('./chunks/dep-4f6e688c.js').then(function (n) { return n.H; });
841
841
  const buildOptions = cleanOptions(options);
842
842
  try {
843
843
  await build({
@@ -865,7 +865,7 @@ cli
865
865
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
866
866
  .action(async (root, options) => {
867
867
  filterDuplicateOptions(options);
868
- const { optimizeDeps } = await import('./chunks/dep-3936e161.js').then(function (n) { return n.G; });
868
+ const { optimizeDeps } = await import('./chunks/dep-4f6e688c.js').then(function (n) { return n.G; });
869
869
  try {
870
870
  const config = await resolveConfig({
871
871
  root,
@@ -892,7 +892,7 @@ cli
892
892
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
893
893
  .action(async (root, options) => {
894
894
  filterDuplicateOptions(options);
895
- const { preview } = await import('./chunks/dep-3936e161.js').then(function (n) { return n.J; });
895
+ const { preview } = await import('./chunks/dep-4f6e688c.js').then(function (n) { return n.J; });
896
896
  try {
897
897
  const server = await preview({
898
898
  root,
@@ -1,5 +1,5 @@
1
- import { i as isInNodeModules } from './chunks/dep-3936e161.js';
2
- export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-3936e161.js';
1
+ import { i as isInNodeModules } from './chunks/dep-4f6e688c.js';
2
+ export { b as build, e as buildErrorMessage, v as createFilter, x as createLogger, c as createServer, g as defineConfig, f as formatPostcssSourceMap, k as getDepOptimizationConfig, m as isDepsOptimizerEnabled, z as isFileServingAllowed, l as loadConfigFromFile, A as loadEnv, u as mergeAlias, q as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, j as resolveBaseUrl, h as resolveConfig, B as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, y as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-4f6e688c.js';
3
3
  export { VERSION as version } from './constants.js';
4
4
  export { version as esbuildVersion } from 'esbuild';
5
5
  export { VERSION as rollupVersion } from 'rollup';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "4.5.9",
3
+ "version": "4.5.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",