vite 6.0.0-beta.0 → 6.0.0-beta.1

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.
@@ -57211,6 +57211,9 @@ function transformMiddleware(server) {
57211
57211
  if (publicDirInRoot && url.startsWith(publicPath)) {
57212
57212
  warnAboutExplicitPublicPathInUrl(url);
57213
57213
  }
57214
+ if ((rawRE.test(url) || urlRE.test(url)) && !ensureServingAccess(url, server, res, next)) {
57215
+ return;
57216
+ }
57214
57217
  if (isJSRequest(url) || isImportRequest(url) || isCSSRequest(url) || isHTMLProxy(url)) {
57215
57218
  url = removeImportQuery(url);
57216
57219
  url = unwrapId$1(url);
@@ -63229,8 +63232,8 @@ function createCachedImport(imp) {
63229
63232
  return cached;
63230
63233
  };
63231
63234
  }
63232
- const importPostcssImport = createCachedImport(() => import('./dep-CSD_20z-.js').then(function (n) { return n.i; }));
63233
- const importPostcssModules = createCachedImport(() => import('./dep-D9t7igss.js').then(function (n) { return n.i; }));
63235
+ const importPostcssImport = createCachedImport(() => import('./dep-DiM5uMHt.js').then(function (n) { return n.i; }));
63236
+ const importPostcssModules = createCachedImport(() => import('./dep-BZeeNeMJ.js').then(function (n) { return n.i; }));
63234
63237
  const importPostcss = createCachedImport(() => import('postcss'));
63235
63238
  const preprocessorWorkerControllerCache = /* @__PURE__ */ new WeakMap();
63236
63239
  let alwaysFakeWorkerWorkerControllerCache;
@@ -64446,19 +64449,22 @@ function preload(baseModule, deps, importerUrl) {
64446
64449
  })
64447
64450
  );
64448
64451
  }
64452
+ function handlePreloadError(err) {
64453
+ const e = new Event("vite:preloadError", {
64454
+ cancelable: true
64455
+ });
64456
+ e.payload = err;
64457
+ window.dispatchEvent(e);
64458
+ if (!e.defaultPrevented) {
64459
+ throw err;
64460
+ }
64461
+ }
64449
64462
  return promise.then((res) => {
64450
64463
  for (const item of res || []) {
64451
64464
  if (item.status !== "rejected") continue;
64452
- const e = new Event("vite:preloadError", {
64453
- cancelable: true
64454
- });
64455
- e.payload = item.reason;
64456
- window.dispatchEvent(e);
64457
- if (!e.defaultPrevented) {
64458
- throw item.reason;
64459
- }
64465
+ handlePreloadError(item.reason);
64460
64466
  }
64461
- return baseModule();
64467
+ return baseModule().catch(handlePreloadError);
64462
64468
  });
64463
64469
  }
64464
64470
  function buildImportAnalysisPlugin(config) {
@@ -65655,7 +65661,7 @@ function escapeId(id) {
65655
65661
  }
65656
65662
  const getResolveUrl = (path2, URL = "URL") => `new ${URL}(${path2}).href`;
65657
65663
  const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(
65658
- `'${escapeId(partialEncodeURIPath(relativePath))}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ""}document.currentScript && document.currentScript.src || document.baseURI`
65664
+ `'${escapeId(partialEncodeURIPath(relativePath))}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ""}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`
65659
65665
  );
65660
65666
  const getFileUrlFromFullPath = (path2) => `require('u' + 'rl').pathToFileURL(${path2}).href`;
65661
65667
  const getFileUrlFromRelativePath = (path2) => getFileUrlFromFullPath(`__dirname + '/${escapeId(path2)}'`);
@@ -1,4 +1,4 @@
1
- import { K as commonjsGlobal, J as getDefaultExportFromCjs } from './dep-Bv1xMYNy.js';
1
+ import { K as commonjsGlobal, J as getDefaultExportFromCjs } from './dep-BZ_CwQkz.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 { J as getDefaultExportFromCjs } from './dep-Bv1xMYNy.js';
1
+ import { J as getDefaultExportFromCjs } from './dep-BZ_CwQkz.js';
2
2
  import require$$0 from 'path';
3
3
  import require$$0__default from 'fs';
4
4
  import { l as lib } from './dep-IQS-Za7F.js';
package/dist/node/cli.js CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
2
2
  import fs__default from 'node:fs';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import { EventEmitter } from 'events';
5
- import { I as colors, A as createLogger, r as resolveConfig } from './chunks/dep-Bv1xMYNy.js';
5
+ import { I as colors, A as createLogger, r as resolveConfig } from './chunks/dep-BZ_CwQkz.js';
6
6
  import { VERSION } from './constants.js';
7
7
  import 'node:fs/promises';
8
8
  import 'node:url';
@@ -736,7 +736,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
736
736
  `[boolean] force the optimizer to ignore the cache and re-bundle`
737
737
  ).action(async (root, options) => {
738
738
  filterDuplicateOptions(options);
739
- const { createServer } = await import('./chunks/dep-Bv1xMYNy.js').then(function (n) { return n.M; });
739
+ const { createServer } = await import('./chunks/dep-BZ_CwQkz.js').then(function (n) { return n.M; });
740
740
  try {
741
741
  const server = await createServer({
742
742
  root,
@@ -829,7 +829,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
829
829
  ).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as builder.entireApp`).action(
830
830
  async (root, options) => {
831
831
  filterDuplicateOptions(options);
832
- const build = await import('./chunks/dep-Bv1xMYNy.js').then(function (n) { return n.N; });
832
+ const build = await import('./chunks/dep-BZ_CwQkz.js').then(function (n) { return n.N; });
833
833
  const buildOptions = cleanGlobalCLIOptions(
834
834
  cleanBuilderCLIOptions(options)
835
835
  );
@@ -884,7 +884,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
884
884
  ).action(
885
885
  async (root, options) => {
886
886
  filterDuplicateOptions(options);
887
- const { optimizeDeps } = await import('./chunks/dep-Bv1xMYNy.js').then(function (n) { return n.L; });
887
+ const { optimizeDeps } = await import('./chunks/dep-BZ_CwQkz.js').then(function (n) { return n.L; });
888
888
  try {
889
889
  const config = await resolveConfig(
890
890
  {
@@ -910,7 +910,7 @@ ${e.stack}`),
910
910
  cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
911
911
  async (root, options) => {
912
912
  filterDuplicateOptions(options);
913
- const { preview } = await import('./chunks/dep-Bv1xMYNy.js').then(function (n) { return n.O; });
913
+ const { preview } = await import('./chunks/dep-BZ_CwQkz.js').then(function (n) { return n.O; });
914
914
  try {
915
915
  const server = await preview({
916
916
  root,
@@ -1,6 +1,6 @@
1
1
  export { parseAst, parseAstAsync } from 'rollup/parseAst';
2
- import { i as isInNodeModules, a as arraify } from './chunks/dep-Bv1xMYNy.js';
3
- export { B as BuildEnvironment, D as DevEnvironment, b as build, j as buildErrorMessage, e as createBuilder, x as createFilter, f as createIdResolver, A as createLogger, k as createNodeDevEnvironment, c as createServer, n as createServerHotChannel, d as defineConfig, m as fetchModule, g as formatPostcssSourceMap, F as isFileLoadingAllowed, E as isFileServingAllowed, l as loadConfigFromFile, G as loadEnv, w as mergeAlias, v as mergeConfig, q as moduleRunnerTransform, u as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, H as resolveEnvPrefix, y as rollupVersion, C as searchForWorkspaceRoot, z as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-Bv1xMYNy.js';
2
+ import { i as isInNodeModules, a as arraify } from './chunks/dep-BZ_CwQkz.js';
3
+ export { B as BuildEnvironment, D as DevEnvironment, b as build, j as buildErrorMessage, e as createBuilder, x as createFilter, f as createIdResolver, A as createLogger, k as createNodeDevEnvironment, c as createServer, n as createServerHotChannel, d as defineConfig, m as fetchModule, g as formatPostcssSourceMap, F as isFileLoadingAllowed, E as isFileServingAllowed, l as loadConfigFromFile, G as loadEnv, w as mergeAlias, v as mergeConfig, q as moduleRunnerTransform, u as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, H as resolveEnvPrefix, y as rollupVersion, C as searchForWorkspaceRoot, z as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BZ_CwQkz.js';
4
4
  import { existsSync, readFileSync } from 'node:fs';
5
5
  import { ModuleRunner, ESModulesEvaluator } from 'vite/module-runner';
6
6
  export { VERSION as version } from './constants.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "6.0.0-beta.0",
3
+ "version": "6.0.0-beta.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",