vite 3.2.10 → 3.2.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.
@@ -37354,7 +37354,8 @@ function importAnalysisPlugin(config) {
37354
37354
  // normalize
37355
37355
  const [url, resolvedId] = await normalizeUrl(specifier, start);
37356
37356
  // record as safe modules
37357
- server?.moduleGraph.safeModulesPath.add(fsPathFromUrl(url));
37357
+ const urlWithoutBase = base !== '/' && url.startsWith(base) ? url.replace(base, '/') : url;
37358
+ server?.moduleGraph.safeModulesPath.add(fsPathFromUrl(urlWithoutBase));
37358
37359
  if (url !== specifier) {
37359
37360
  let rewriteDone = false;
37360
37361
  if (depsOptimizer?.isOptimizedDepFile(resolvedId) &&
@@ -44169,7 +44170,7 @@ async function compileCSS(id, code, config, urlReplacer) {
44169
44170
  }));
44170
44171
  }
44171
44172
  if (isModule) {
44172
- postcssPlugins.unshift((await import('./dep-48c482ee.js').then(function (n) { return n.i; })).default({
44173
+ postcssPlugins.unshift((await import('./dep-cedec504.js').then(function (n) { return n.i; })).default({
44173
44174
  ...modulesOptions,
44174
44175
  // TODO: convert null to undefined (`null` should be removed from `CSSModulesOptions.localsConvention`)
44175
44176
  localsConvention: modulesOptions?.localsConvention ?? undefined,
@@ -46049,7 +46050,7 @@ function injectSsrFlag(options) {
46049
46050
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46050
46051
  */
46051
46052
  const getResolveUrl = (path, URL = 'URL') => `new ${URL}(${path}).href`;
46052
- const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.src || document.baseURI`);
46053
+ const getRelativeUrlFromDocument = (relativePath, umd = false) => getResolveUrl(`'${relativePath}', ${umd ? `typeof document === 'undefined' ? location.href : ` : ''}document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || document.baseURI`);
46053
46054
  const relativeUrlMechanisms = {
46054
46055
  amd: (relativePath) => {
46055
46056
  if (relativePath[0] !== '.')
@@ -60357,6 +60358,10 @@ function transformMiddleware(server) {
60357
60358
  logger.warn(picocolors.exports.yellow(warning));
60358
60359
  }
60359
60360
  }
60361
+ if ((rawRE.test(url) || urlRE.test(url)) &&
60362
+ !ensureServingAccess(url, server, res, next)) {
60363
+ return;
60364
+ }
60360
60365
  if (isJSRequest(url) ||
60361
60366
  isImportRequest(url) ||
60362
60367
  isCSSRequest(url) ||
@@ -1,6 +1,6 @@
1
1
  import require$$0__default from 'fs';
2
2
  import require$$0 from 'postcss';
3
- import { A as commonjsGlobal } from './dep-372dab03.js';
3
+ import { A as commonjsGlobal } from './dep-3e87c7b2.js';
4
4
  import require$$0$1 from 'path';
5
5
  import require$$5 from 'crypto';
6
6
  import require$$0$2 from 'util';
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { performance } from 'node:perf_hooks';
2
2
  import { EventEmitter } from 'events';
3
- import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-372dab03.js';
3
+ import { z as picocolors, v as createLogger, g as resolveConfig } from './chunks/dep-3e87c7b2.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'node:fs';
6
6
  import 'node:path';
@@ -702,7 +702,7 @@ cli
702
702
  filterDuplicateOptions(options);
703
703
  // output structure is preserved even after bundling so require()
704
704
  // is ok here
705
- const { createServer } = await import('./chunks/dep-372dab03.js').then(function (n) { return n.D; });
705
+ const { createServer } = await import('./chunks/dep-3e87c7b2.js').then(function (n) { return n.D; });
706
706
  try {
707
707
  const server = await createServer({
708
708
  root,
@@ -750,7 +750,7 @@ cli
750
750
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
751
751
  .action(async (root, options) => {
752
752
  filterDuplicateOptions(options);
753
- const { build } = await import('./chunks/dep-372dab03.js').then(function (n) { return n.C; });
753
+ const { build } = await import('./chunks/dep-3e87c7b2.js').then(function (n) { return n.C; });
754
754
  const buildOptions = cleanOptions(options);
755
755
  try {
756
756
  await build({
@@ -775,7 +775,7 @@ cli
775
775
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
776
776
  .action(async (root, options) => {
777
777
  filterDuplicateOptions(options);
778
- const { optimizeDeps } = await import('./chunks/dep-372dab03.js').then(function (n) { return n.B; });
778
+ const { optimizeDeps } = await import('./chunks/dep-3e87c7b2.js').then(function (n) { return n.B; });
779
779
  try {
780
780
  const config = await resolveConfig({
781
781
  root,
@@ -800,7 +800,7 @@ cli
800
800
  .option('--outDir <dir>', `[string] output directory (default: dist)`)
801
801
  .action(async (root, options) => {
802
802
  filterDuplicateOptions(options);
803
- const { preview } = await import('./chunks/dep-372dab03.js').then(function (n) { return n.E; });
803
+ const { preview } = await import('./chunks/dep-3e87c7b2.js').then(function (n) { return n.E; });
804
804
  try {
805
805
  const server = await preview({
806
806
  root,
@@ -1,7 +1,7 @@
1
1
  import path, { resolve } from 'node:path';
2
2
  import { fileURLToPath } from 'node:url';
3
3
 
4
- var version = "3.2.10";
4
+ var version = "3.2.11";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -1,4 +1,4 @@
1
- export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-372dab03.js';
1
+ export { b as build, q as createFilter, v as createLogger, c as createServer, e as defineConfig, f as formatPostcssSourceMap, i as getDepOptimizationConfig, j as isDepsOptimizerEnabled, l as loadConfigFromFile, x as loadEnv, k as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, a as preprocessCSS, p as preview, h as resolveBaseUrl, g as resolveConfig, y as resolveEnvPrefix, d as resolvePackageData, r as resolvePackageEntry, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-3e87c7b2.js';
2
2
  export { VERSION as version } from './constants.js';
3
3
  export { version as esbuildVersion } from 'esbuild';
4
4
  export { VERSION as rollupVersion } from 'rollup';
@@ -31,7 +31,7 @@ var require$$1__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$1$1);
31
31
  var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
32
32
  var require$$2__default = /*#__PURE__*/_interopDefaultLegacy(require$$2);
33
33
 
34
- var version = "3.2.10";
34
+ var version = "3.2.11";
35
35
 
36
36
  const VERSION = version;
37
37
  const VITE_PACKAGE_DIR = path$3.resolve(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "3.2.10",
3
+ "version": "3.2.11",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",