vite 3.0.0-beta.5 → 3.0.0-beta.6

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.
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 { x as picocolors, q as createLogger, e as resolveConfig } from './chunks/dep-332aa27f.js';
3
+ import { x as picocolors, q as createLogger, e as resolveConfig } from './chunks/dep-c7f6d0a5.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'node:fs';
6
6
  import 'node:path';
@@ -694,7 +694,7 @@ cli
694
694
  .action(async (root, options) => {
695
695
  // output structure is preserved even after bundling so require()
696
696
  // is ok here
697
- const { createServer } = await import('./chunks/dep-332aa27f.js').then(function (n) { return n.D; });
697
+ const { createServer } = await import('./chunks/dep-c7f6d0a5.js').then(function (n) { return n.D; });
698
698
  try {
699
699
  const server = await createServer({
700
700
  root,
@@ -741,7 +741,7 @@ cli
741
741
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
742
742
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
743
743
  .action(async (root, options) => {
744
- const { build } = await import('./chunks/dep-332aa27f.js').then(function (n) { return n.C; });
744
+ const { build } = await import('./chunks/dep-c7f6d0a5.js').then(function (n) { return n.C; });
745
745
  const buildOptions = cleanOptions(options);
746
746
  try {
747
747
  await build({
@@ -765,7 +765,7 @@ cli
765
765
  .command('optimize [root]', 'pre-bundle dependencies')
766
766
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
767
767
  .action(async (root, options) => {
768
- const { optimizeDeps } = await import('./chunks/dep-332aa27f.js').then(function (n) { return n.B; });
768
+ const { optimizeDeps } = await import('./chunks/dep-c7f6d0a5.js').then(function (n) { return n.B; });
769
769
  try {
770
770
  const config = await resolveConfig({
771
771
  root,
@@ -788,7 +788,7 @@ cli
788
788
  .option('--https', `[boolean] use TLS + HTTP/2`)
789
789
  .option('--open [path]', `[boolean | string] open browser on startup`)
790
790
  .action(async (root, options) => {
791
- const { preview } = await import('./chunks/dep-332aa27f.js').then(function (n) { return n.E; });
791
+ const { preview } = await import('./chunks/dep-c7f6d0a5.js').then(function (n) { return n.E; });
792
792
  try {
793
793
  const server = await preview({
794
794
  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.0.0-beta.5";
4
+ var version = "3.0.0-beta.6";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -35,7 +35,7 @@ const DEFAULT_CONFIG_FILES = [
35
35
  'vite.config.cts'
36
36
  ];
37
37
  const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
38
- const OPTIMIZABLE_ENTRY_RE = /\.(?:m?js|ts)$/;
38
+ const OPTIMIZABLE_ENTRY_RE = /\.(?:(m|c)?js|ts)$/;
39
39
  const SPECIAL_QUERY_RE = /[\?&](?:worker|sharedworker|raw|url)\b/;
40
40
  /**
41
41
  * Prefix for resolved fs paths, since windows paths may not be valid as URLs.
@@ -326,6 +326,7 @@ export declare interface CommonServerOptions {
326
326
  export declare interface ConfigEnv {
327
327
  command: 'build' | 'serve';
328
328
  mode: string;
329
+ ssrBuild: boolean;
329
330
  }
330
331
 
331
332
  export declare namespace Connect {
@@ -475,7 +476,7 @@ export declare interface CSSOptions {
475
476
  modules?: CSSModulesOptions | false;
476
477
  preprocessorOptions?: Record<string, any>;
477
478
  postcss?: string | (PostCSS.ProcessOptions & {
478
- plugins?: PostCSS.Plugin[];
479
+ plugins?: PostCSS.AcceptedPlugin[];
479
480
  });
480
481
  /**
481
482
  * Enables css sourcemaps during dev
@@ -618,9 +619,7 @@ export declare interface DepOptimizationResult {
618
619
  }
619
620
 
620
621
  export declare interface DepsOptimizer {
621
- metadata: (options: {
622
- ssr: boolean;
623
- }) => DepOptimizationMetadata;
622
+ metadata: DepOptimizationMetadata;
624
623
  scanProcessing?: Promise<void>;
625
624
  registerMissingImport: (id: string, resolved: string, ssr?: boolean) => OptimizedDepInfo;
626
625
  run: () => void;
@@ -1207,7 +1206,9 @@ export declare interface InternalResolveOptions extends ResolveOptions {
1207
1206
  isFromTsImporter?: boolean;
1208
1207
  tryEsmOnly?: boolean;
1209
1208
  scan?: boolean;
1210
- getDepsOptimizer?: () => DepsOptimizer | undefined;
1209
+ getDepsOptimizer?: (type: {
1210
+ ssr?: boolean;
1211
+ }) => DepsOptimizer | undefined;
1211
1212
  shouldExternalize?: (id: string) => boolean | undefined;
1212
1213
  }
1213
1214
 
@@ -1360,7 +1361,7 @@ export declare class ModuleGraph {
1360
1361
  * returned as a Set.
1361
1362
  */
1362
1363
  updateModuleInfo(mod: ModuleNode, importedModules: Set<string | ModuleNode>, importedBindings: Map<string, Set<string>> | null, acceptedModules: Set<string | ModuleNode>, acceptedExports: Set<string> | null, isSelfAccepting: boolean, ssr?: boolean): Promise<Set<ModuleNode> | undefined>;
1363
- ensureEntryFromUrl(rawUrl: string, ssr?: boolean): Promise<ModuleNode>;
1364
+ ensureEntryFromUrl(rawUrl: string, ssr?: boolean, setIsSelfAccepting?: boolean): Promise<ModuleNode>;
1364
1365
  createFileOnlyEntry(file: string): ModuleNode;
1365
1366
  resolveUrl(url: string, ssr?: boolean): Promise<ResolvedUrl>;
1366
1367
  }
@@ -1390,7 +1391,10 @@ export declare class ModuleNode {
1390
1391
  ssrError: Error | null;
1391
1392
  lastHMRTimestamp: number;
1392
1393
  lastInvalidationTimestamp: number;
1393
- constructor(url: string);
1394
+ /**
1395
+ * @param setIsSelfAccepting - set `false` to set `isSelfAccepting` later. e.g. #7870
1396
+ */
1397
+ constructor(url: string, setIsSelfAccepting?: boolean);
1394
1398
  }
1395
1399
 
1396
1400
  export declare function normalizePath(id: string): string;
@@ -1986,6 +1990,13 @@ export declare interface ServerOptions extends CommonServerOptions {
1986
1990
  * @default true
1987
1991
  */
1988
1992
  preTransformRequests?: boolean;
1993
+ /**
1994
+ * Force dep pre-optimization regardless of whether deps have changed.
1995
+ *
1996
+ * @deprecated Use optimizeDeps.force instead, this option may be removed
1997
+ * in a future minor version without following semver
1998
+ */
1999
+ force?: boolean;
1989
2000
  }
1990
2001
 
1991
2002
  export declare function sortUserPlugins(plugins: (Plugin_2 | Plugin_2[])[] | undefined): [Plugin_2[], Plugin_2[], Plugin_2[]];
@@ -1,4 +1,4 @@
1
- export { b as build, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, v as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, w as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-332aa27f.js';
1
+ export { b as build, j as createFilter, q as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, i as isDepsOptimizerEnabled, l as loadConfigFromFile, v as loadEnv, h as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, w as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, u as searchForWorkspaceRoot, k as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-c7f6d0a5.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.0.0-beta.5";
34
+ var version = "3.0.0-beta.6";
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.0.0-beta.5",
3
+ "version": "3.0.0-beta.6",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -20,7 +20,8 @@
20
20
  "./client": {
21
21
  "types": "./client.d.ts"
22
22
  },
23
- "./dist/client/*": "./dist/client/*"
23
+ "./dist/client/*": "./dist/client/*",
24
+ "./package.json": "./package.json"
24
25
  },
25
26
  "files": [
26
27
  "bin",
@@ -67,9 +68,9 @@
67
68
  },
68
69
  "devDependencies": {
69
70
  "@ampproject/remapping": "^2.2.0",
70
- "@babel/parser": "^7.18.5",
71
- "@babel/types": "^7.18.4",
72
- "@jridgewell/trace-mapping": "^0.3.13",
71
+ "@babel/parser": "^7.18.6",
72
+ "@babel/types": "^7.18.7",
73
+ "@jridgewell/trace-mapping": "^0.3.14",
73
74
  "@rollup/plugin-alias": "^3.1.9",
74
75
  "@rollup/plugin-commonjs": "^22.0.1",
75
76
  "@rollup/plugin-dynamic-import-vars": "^1.4.3",
@@ -82,7 +83,7 @@
82
83
  "cac": "^6.7.12",
83
84
  "chokidar": "^3.5.3",
84
85
  "connect": "^3.7.0",
85
- "connect-history-api-fallback": "^1.6.0",
86
+ "connect-history-api-fallback": "^2.0.0",
86
87
  "convert-source-map": "^1.8.0",
87
88
  "cors": "^2.8.5",
88
89
  "cross-spawn": "^7.0.3",
@@ -98,7 +99,7 @@
98
99
  "launch-editor-middleware": "^2.4.0",
99
100
  "magic-string": "^0.26.2",
100
101
  "micromatch": "^4.0.5",
101
- "mlly": "^0.5.3",
102
+ "mlly": "^0.5.4",
102
103
  "mrmime": "^1.0.1",
103
104
  "node-forge": "^1.3.1",
104
105
  "okie": "^1.0.1",
@@ -2,8 +2,6 @@
2
2
  "extends": "../../tsconfig.base.json",
3
3
  "include": ["./", "../../types"],
4
4
  "compilerOptions": {
5
- "outDir": "../../dist/client",
6
- "module": "ESNext",
7
5
  "types": [],
8
6
  "lib": ["ESNext", "DOM"],
9
7
  "declaration": false