vite 5.1.0-beta.1 → 5.1.0-beta.2

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.
@@ -1,4 +1,4 @@
1
- import { A as commonjsGlobal, z as getDefaultExportFromCjs } from './dep-jUaJI_Cb.js';
1
+ import { A as commonjsGlobal, z as getDefaultExportFromCjs } from './dep-BzxBS-ea.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 { z as getDefaultExportFromCjs } from './dep-jUaJI_Cb.js';
1
+ import { z as getDefaultExportFromCjs } from './dep-BzxBS-ea.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-8a-6Quh6.js';
@@ -31851,8 +31851,8 @@ function createCachedImport(imp) {
31851
31851
  return cached;
31852
31852
  };
31853
31853
  }
31854
- const importPostcssImport = createCachedImport(() => import('./dep-vM06sRGH.js').then(function (n) { return n.i; }));
31855
- const importPostcssModules = createCachedImport(() => import('./dep-pPggWEp0.js').then(function (n) { return n.i; }));
31854
+ const importPostcssImport = createCachedImport(() => import('./dep-AFY35plO.js').then(function (n) { return n.i; }));
31855
+ const importPostcssModules = createCachedImport(() => import('./dep-7G7SPddr.js').then(function (n) { return n.i; }));
31856
31856
  const importPostcss = createCachedImport(() => import('postcss'));
31857
31857
  /**
31858
31858
  * @experimental
@@ -49680,26 +49680,27 @@ function createPluginHookUtils(plugins) {
49680
49680
  };
49681
49681
  }
49682
49682
  function getSortedPluginsByHook(hookName, plugins) {
49683
- const pre = [];
49684
- const normal = [];
49685
- const post = [];
49683
+ const sortedPlugins = [];
49684
+ // Use indexes to track and insert the ordered plugins directly in the
49685
+ // resulting array to avoid creating 3 extra temporary arrays per hook
49686
+ let pre = 0, normal = 0, post = 0;
49686
49687
  for (const plugin of plugins) {
49687
49688
  const hook = plugin[hookName];
49688
49689
  if (hook) {
49689
49690
  if (typeof hook === 'object') {
49690
49691
  if (hook.order === 'pre') {
49691
- pre.push(plugin);
49692
+ sortedPlugins.splice(pre++, 0, plugin);
49692
49693
  continue;
49693
49694
  }
49694
49695
  if (hook.order === 'post') {
49695
- post.push(plugin);
49696
+ sortedPlugins.splice(pre + normal + post++, 0, plugin);
49696
49697
  continue;
49697
49698
  }
49698
49699
  }
49699
- normal.push(plugin);
49700
+ sortedPlugins.splice(pre + normal++, 0, plugin);
49700
49701
  }
49701
49702
  }
49702
- return [...pre, ...normal, ...post];
49703
+ return sortedPlugins;
49703
49704
  }
49704
49705
  function getHookHandler(hook) {
49705
49706
  return (typeof hook === 'object' ? hook.handler : hook);
@@ -53076,6 +53077,7 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
53076
53077
  const sourcemapPath = `${mod.file}.map`;
53077
53078
  applySourcemapIgnoreList(normalizedMap, sourcemapPath, config.server.sourcemapIgnoreList, logger);
53078
53079
  if (path$o.isAbsolute(mod.file)) {
53080
+ let modDirname;
53079
53081
  for (let sourcesIndex = 0; sourcesIndex < normalizedMap.sources.length; ++sourcesIndex) {
53080
53082
  const sourcePath = normalizedMap.sources[sourcesIndex];
53081
53083
  if (sourcePath) {
@@ -53083,7 +53085,8 @@ async function loadAndTransform(id, url, server, options, timestamp, mod, resolv
53083
53085
  // to resolve and display them in a meaningful way (rather than
53084
53086
  // with absolute paths).
53085
53087
  if (path$o.isAbsolute(sourcePath)) {
53086
- normalizedMap.sources[sourcesIndex] = path$o.relative(path$o.dirname(mod.file), sourcePath);
53088
+ modDirname ??= path$o.dirname(mod.file);
53089
+ normalizedMap.sources[sourcesIndex] = path$o.relative(modDirname, sourcePath);
53087
53090
  }
53088
53091
  }
53089
53092
  }
@@ -63791,7 +63794,10 @@ async function _createServer(inlineConfig = {}, options) {
63791
63794
  _importGlobMap: new Map(),
63792
63795
  _forceOptimizeOnRestart: false,
63793
63796
  _pendingRequests: new Map(),
63794
- _fsDenyGlob: picomatch$4(config.server.fs.deny, { matchBase: true }),
63797
+ _fsDenyGlob: picomatch$4(config.server.fs.deny, {
63798
+ matchBase: true,
63799
+ nocase: true,
63800
+ }),
63795
63801
  _shortcutsOptions: undefined,
63796
63802
  };
63797
63803
  // maintain consistency with the server instance after restarting.
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 { y as colors, q as createLogger, r as resolveConfig } from './chunks/dep-jUaJI_Cb.js';
5
+ import { y as colors, q as createLogger, r as resolveConfig } from './chunks/dep-BzxBS-ea.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -758,7 +758,7 @@ cli
758
758
  filterDuplicateOptions(options);
759
759
  // output structure is preserved even after bundling so require()
760
760
  // is ok here
761
- const { createServer } = await import('./chunks/dep-jUaJI_Cb.js').then(function (n) { return n.C; });
761
+ const { createServer } = await import('./chunks/dep-BzxBS-ea.js').then(function (n) { return n.C; });
762
762
  try {
763
763
  const server = await createServer({
764
764
  root,
@@ -838,7 +838,7 @@ cli
838
838
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
839
839
  .action(async (root, options) => {
840
840
  filterDuplicateOptions(options);
841
- const { build } = await import('./chunks/dep-jUaJI_Cb.js').then(function (n) { return n.D; });
841
+ const { build } = await import('./chunks/dep-BzxBS-ea.js').then(function (n) { return n.D; });
842
842
  const buildOptions = cleanOptions(options);
843
843
  try {
844
844
  await build({
@@ -866,7 +866,7 @@ cli
866
866
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
867
867
  .action(async (root, options) => {
868
868
  filterDuplicateOptions(options);
869
- const { optimizeDeps } = await import('./chunks/dep-jUaJI_Cb.js').then(function (n) { return n.B; });
869
+ const { optimizeDeps } = await import('./chunks/dep-BzxBS-ea.js').then(function (n) { return n.B; });
870
870
  try {
871
871
  const config = await resolveConfig({
872
872
  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-jUaJI_Cb.js').then(function (n) { return n.E; });
895
+ const { preview } = await import('./chunks/dep-BzxBS-ea.js').then(function (n) { return n.E; });
896
896
  try {
897
897
  const server = await preview({
898
898
  root,
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-jUaJI_Cb.js';
3
- export { b as build, g as buildErrorMessage, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, v as isFileServingAllowed, l as loadConfigFromFile, w as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, x as resolveEnvPrefix, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-jUaJI_Cb.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-BzxBS-ea.js';
3
+ export { b as build, g as buildErrorMessage, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, v as isFileServingAllowed, l as loadConfigFromFile, w as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, x as resolveEnvPrefix, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BzxBS-ea.js';
4
4
  export { VERSION as version } from './constants.js';
5
5
  export { version as esbuildVersion } from 'esbuild';
6
6
  export { VERSION as rollupVersion } from 'rollup';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "5.1.0-beta.1",
3
+ "version": "5.1.0-beta.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",