vite 3.0.0-alpha.10 → 3.0.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  import require$$0 from 'postcss';
2
- import { w as commonjsGlobal } from './dep-134b43f1.js';
2
+ import { x as commonjsGlobal } from './dep-46501b7a.js';
3
3
  import path$2 from 'path';
4
4
  import require$$1 from 'crypto';
5
5
  import fs__default from 'fs';
@@ -1,4 +1,4 @@
1
- import { x as getAugmentedNamespace, y as getDefaultExportFromCjs } from './dep-134b43f1.js';
1
+ import { y as getAugmentedNamespace, z as getDefaultExportFromCjs } from './dep-46501b7a.js';
2
2
 
3
3
  import { fileURLToPath as __cjs_fileURLToPath } from 'url';
4
4
  import { dirname as __cjs_dirname } from 'path';
@@ -1,4 +1,4 @@
1
- import { w as commonjsGlobal } from './dep-134b43f1.js';
1
+ import { x as commonjsGlobal } from './dep-46501b7a.js';
2
2
  import require$$1 from 'crypto';
3
3
  import 'fs';
4
4
  import 'path';
@@ -16,6 +16,7 @@ import 'http';
16
16
  import 'stream';
17
17
  import 'os';
18
18
  import 'child_process';
19
+ import 'dns';
19
20
  import '../constants.js';
20
21
  import 'buffer';
21
22
  import 'querystring';
package/dist/node/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { performance } from 'perf_hooks';
2
2
  import { EventEmitter } from 'events';
3
- import { v as colors, j as createLogger, e as resolveConfig } from './chunks/dep-134b43f1.js';
3
+ import { w as colors, k as createLogger, e as resolveConfig } from './chunks/dep-46501b7a.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'fs';
6
6
  import 'path';
@@ -16,6 +16,7 @@ import 'http';
16
16
  import 'stream';
17
17
  import 'os';
18
18
  import 'child_process';
19
+ import 'dns';
19
20
  import 'crypto';
20
21
  import 'buffer';
21
22
  import 'querystring';
@@ -682,7 +683,7 @@ cli
682
683
  .action(async (root, options) => {
683
684
  // output structure is preserved even after bundling so require()
684
685
  // is ok here
685
- const { createServer } = await import('./chunks/dep-134b43f1.js').then(function (n) { return n.B; });
686
+ const { createServer } = await import('./chunks/dep-46501b7a.js').then(function (n) { return n.C; });
686
687
  try {
687
688
  const server = await createServer({
688
689
  root,
@@ -728,7 +729,7 @@ cli
728
729
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
729
730
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
730
731
  .action(async (root, options) => {
731
- const { build } = await import('./chunks/dep-134b43f1.js').then(function (n) { return n.A; });
732
+ const { build } = await import('./chunks/dep-46501b7a.js').then(function (n) { return n.B; });
732
733
  const buildOptions = cleanOptions(options);
733
734
  try {
734
735
  await build({
@@ -752,7 +753,7 @@ cli
752
753
  .command('optimize [root]', 'pre-bundle dependencies')
753
754
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
754
755
  .action(async (root, options) => {
755
- const { optimizeDeps } = await import('./chunks/dep-134b43f1.js').then(function (n) { return n.z; });
756
+ const { optimizeDeps } = await import('./chunks/dep-46501b7a.js').then(function (n) { return n.A; });
756
757
  try {
757
758
  const config = await resolveConfig({
758
759
  root,
@@ -775,7 +776,7 @@ cli
775
776
  .option('--https', `[boolean] use TLS + HTTP/2`)
776
777
  .option('--open [path]', `[boolean | string] open browser on startup`)
777
778
  .action(async (root, options) => {
778
- const { preview } = await import('./chunks/dep-134b43f1.js').then(function (n) { return n.C; });
779
+ const { preview } = await import('./chunks/dep-46501b7a.js').then(function (n) { return n.D; });
779
780
  try {
780
781
  const server = await preview({
781
782
  root,
@@ -1,7 +1,7 @@
1
1
  import path, { resolve } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
 
4
- var version = "3.0.0-alpha.10";
4
+ var version = "3.0.0-alpha.11";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -48,11 +48,17 @@ const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
48
48
  const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
49
49
  // ** READ THIS ** before editing `KNOWN_ASSET_TYPES`.
50
50
  // If you add an asset to `KNOWN_ASSET_TYPES`, make sure to also add it
51
- // to the TypeScript declaration file `packages/vite/client.d.ts`.
51
+ // to the TypeScript declaration file `packages/vite/client.d.ts` and
52
+ // add a mime type to the `registerCustomMime` in
53
+ // `packages/vite/src/node/plugin/assets.ts` if mime type cannot be
54
+ // looked up by mrmime.
52
55
  const KNOWN_ASSET_TYPES = [
53
56
  // images
54
57
  'png',
55
58
  'jpe?g',
59
+ 'jfif',
60
+ 'pjpeg',
61
+ 'pjp',
56
62
  'gif',
57
63
  'svg',
58
64
  'ico',
@@ -78,5 +84,16 @@ const KNOWN_ASSET_TYPES = [
78
84
  ];
79
85
  const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`);
80
86
  const DEP_VERSION_RE = /[\?&](v=[\w\.-]+)\b/;
87
+ const loopbackHosts = new Set([
88
+ 'localhost',
89
+ '127.0.0.1',
90
+ '::1',
91
+ '0000:0000:0000:0000:0000:0000:0000:0001'
92
+ ]);
93
+ const wildcardHosts = new Set([
94
+ '0.0.0.0',
95
+ '::',
96
+ '0000:0000:0000:0000:0000:0000:0000:0000'
97
+ ]);
81
98
 
82
- export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, DEFAULT_ASSETS_RE, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR };
99
+ export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, DEFAULT_ASSETS_RE, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, NULL_BYTE_PLACEHOLDER, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VALID_ID_PREFIX, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
@@ -437,6 +437,10 @@ export declare interface CorsOptions {
437
437
 
438
438
  export declare type CorsOrigin = boolean | string | RegExp | (string | RegExp)[];
439
439
 
440
+ export declare const createFilter: (include?: FilterPattern | undefined, exclude?: FilterPattern | undefined, options?: {
441
+ resolve?: string | false | null | undefined;
442
+ } | undefined) => (id: string | unknown) => boolean;
443
+
440
444
  export declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
441
445
 
442
446
  export declare function createServer(inlineConfig?: InlineConfig): Promise<ViteDevServer>;
@@ -693,6 +697,11 @@ export declare interface FileSystemServeOptions {
693
697
  deny?: string[];
694
698
  }
695
699
 
700
+ /**
701
+ * Inlined to keep `@rollup/pluginutils` in devDependencies
702
+ */
703
+ export declare type FilterPattern = ReadonlyArray<string | RegExp> | string | RegExp | null;
704
+
696
705
  export declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
697
706
 
698
707
  export declare class FSWatcher extends EventEmitter implements fs.FSWatcher {
@@ -1,4 +1,4 @@
1
- export { b as build, j as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, q as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, e as resolveConfig, u as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, k as searchForWorkspaceRoot, h as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-134b43f1.js';
1
+ export { b as build, h as createFilter, k as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, u as loadEnv, g as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, e as resolveConfig, v as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, q as searchForWorkspaceRoot, j as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-46501b7a.js';
2
2
  export { VERSION as version } from './constants.js';
3
3
  import 'fs';
4
4
  import 'path';
@@ -16,6 +16,7 @@ import 'http';
16
16
  import 'stream';
17
17
  import 'os';
18
18
  import 'child_process';
19
+ import 'dns';
19
20
  import 'crypto';
20
21
  import 'buffer';
21
22
  import 'querystring';