vite 3.0.0-beta.6 → 3.0.0-beta.9

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-c7f6d0a5.js';
3
+ import { y as picocolors, u as createLogger, e as resolveConfig } from './chunks/dep-58325dc2.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-c7f6d0a5.js').then(function (n) { return n.D; });
697
+ const { createServer } = await import('./chunks/dep-58325dc2.js').then(function (n) { return n.E; });
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-c7f6d0a5.js').then(function (n) { return n.C; });
744
+ const { build } = await import('./chunks/dep-58325dc2.js').then(function (n) { return n.D; });
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-c7f6d0a5.js').then(function (n) { return n.B; });
768
+ const { optimizeDeps } = await import('./chunks/dep-58325dc2.js').then(function (n) { return n.C; });
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-c7f6d0a5.js').then(function (n) { return n.E; });
791
+ const { preview } = await import('./chunks/dep-58325dc2.js').then(function (n) { return n.F; });
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.6";
4
+ var version = "3.0.0-beta.9";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -326,7 +326,10 @@ export declare interface CommonServerOptions {
326
326
  export declare interface ConfigEnv {
327
327
  command: 'build' | 'serve';
328
328
  mode: string;
329
- ssrBuild: boolean;
329
+ /**
330
+ * @experimental
331
+ */
332
+ ssrBuild?: boolean;
330
333
  }
331
334
 
332
335
  export declare namespace Connect {
@@ -507,48 +510,7 @@ export declare interface CustomPayload {
507
510
  */
508
511
  export declare function defineConfig(config: UserConfigExport): UserConfigExport;
509
512
 
510
- export declare interface DepOptimizationMetadata {
511
- /**
512
- * The main hash is determined by user config and dependency lockfiles.
513
- * This is checked on server startup to avoid unnecessary re-bundles.
514
- */
515
- hash: string;
516
- /**
517
- * The browser hash is determined by the main hash plus additional dependencies
518
- * discovered at runtime. This is used to invalidate browser requests to
519
- * optimized deps.
520
- */
521
- browserHash: string;
522
- /**
523
- * Metadata for each already optimized dependency
524
- */
525
- optimized: Record<string, OptimizedDepInfo>;
526
- /**
527
- * Metadata for non-entry optimized chunks and dynamic imports
528
- */
529
- chunks: Record<string, OptimizedDepInfo>;
530
- /**
531
- * Metadata for each newly discovered dependency after processing
532
- */
533
- discovered: Record<string, OptimizedDepInfo>;
534
- /**
535
- * OptimizedDepInfo list
536
- */
537
- depInfoList: OptimizedDepInfo[];
538
- }
539
-
540
- export declare interface DepOptimizationOptions {
541
- /**
542
- * By default, Vite will crawl your `index.html` to detect dependencies that
543
- * need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
544
- * will crawl those entry points instead.
545
- *
546
- * If neither of these fit your needs, you can specify custom entries using
547
- * this option - the value should be a fast-glob pattern or array of patterns
548
- * (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
549
- * vite project root. This will overwrite default entries inference.
550
- */
551
- entries?: string | string[];
513
+ export declare interface DepOptimizationConfig {
552
514
  /**
553
515
  * Force optimize listed dependencies (must be resolvable import paths,
554
516
  * cannot be globs).
@@ -595,12 +557,56 @@ export declare interface DepOptimizationOptions {
595
557
  * @experimental
596
558
  */
597
559
  disabled?: boolean | 'build' | 'dev';
560
+ }
561
+
562
+ export declare interface DepOptimizationMetadata {
563
+ /**
564
+ * The main hash is determined by user config and dependency lockfiles.
565
+ * This is checked on server startup to avoid unnecessary re-bundles.
566
+ */
567
+ hash: string;
568
+ /**
569
+ * The browser hash is determined by the main hash plus additional dependencies
570
+ * discovered at runtime. This is used to invalidate browser requests to
571
+ * optimized deps.
572
+ */
573
+ browserHash: string;
574
+ /**
575
+ * Metadata for each already optimized dependency
576
+ */
577
+ optimized: Record<string, OptimizedDepInfo>;
578
+ /**
579
+ * Metadata for non-entry optimized chunks and dynamic imports
580
+ */
581
+ chunks: Record<string, OptimizedDepInfo>;
582
+ /**
583
+ * Metadata for each newly discovered dependency after processing
584
+ */
585
+ discovered: Record<string, OptimizedDepInfo>;
586
+ /**
587
+ * OptimizedDepInfo list
588
+ */
589
+ depInfoList: OptimizedDepInfo[];
590
+ }
591
+
592
+ export declare type DepOptimizationOptions = DepOptimizationConfig & {
593
+ /**
594
+ * By default, Vite will crawl your `index.html` to detect dependencies that
595
+ * need to be pre-bundled. If `build.rollupOptions.input` is specified, Vite
596
+ * will crawl those entry points instead.
597
+ *
598
+ * If neither of these fit your needs, you can specify custom entries using
599
+ * this option - the value should be a fast-glob pattern or array of patterns
600
+ * (https://github.com/mrmlnc/fast-glob#basic-syntax) that are relative from
601
+ * vite project root. This will overwrite default entries inference.
602
+ */
603
+ entries?: string | string[];
598
604
  /**
599
605
  * Force dep pre-optimization regardless of whether deps have changed.
600
606
  * @experimental
601
607
  */
602
608
  force?: boolean;
603
- }
609
+ };
604
610
 
605
611
  export declare interface DepOptimizationProcessing {
606
612
  promise: Promise<void>;
@@ -621,7 +627,7 @@ export declare interface DepOptimizationResult {
621
627
  export declare interface DepsOptimizer {
622
628
  metadata: DepOptimizationMetadata;
623
629
  scanProcessing?: Promise<void>;
624
- registerMissingImport: (id: string, resolved: string, ssr?: boolean) => OptimizedDepInfo;
630
+ registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
625
631
  run: () => void;
626
632
  isOptimizedDepFile: (id: string) => boolean;
627
633
  isOptimizedDepUrl: (url: string) => boolean;
@@ -811,6 +817,8 @@ export declare interface FullReloadPayload {
811
817
  path?: string
812
818
  }
813
819
 
820
+ export declare function getDepOptimizationConfig(config: ResolvedConfig, ssr: boolean): DepOptimizationConfig;
821
+
814
822
  export declare interface HmrContext {
815
823
  file: string;
816
824
  timestamp: number;
@@ -1206,13 +1214,12 @@ export declare interface InternalResolveOptions extends ResolveOptions {
1206
1214
  isFromTsImporter?: boolean;
1207
1215
  tryEsmOnly?: boolean;
1208
1216
  scan?: boolean;
1209
- getDepsOptimizer?: (type: {
1210
- ssr?: boolean;
1211
- }) => DepsOptimizer | undefined;
1217
+ ssrOptimizeCheck?: boolean;
1218
+ getDepsOptimizer?: (ssr: boolean) => DepsOptimizer | undefined;
1212
1219
  shouldExternalize?: (id: string) => boolean | undefined;
1213
1220
  }
1214
1221
 
1215
- export declare function isDepsOptimizerEnabled(config: ResolvedConfig): boolean;
1222
+ export declare function isDepsOptimizerEnabled(config: ResolvedConfig, ssr: boolean): boolean;
1216
1223
 
1217
1224
  export declare interface JsonOptions {
1218
1225
  /**
@@ -1235,22 +1242,6 @@ export declare interface KnownAsTypeMap {
1235
1242
  }
1236
1243
 
1237
1244
  export declare interface LegacyOptions {
1238
- /**
1239
- * Revert vite dev to the v2.9 strategy. Enable esbuild based deps scanner.
1240
- *
1241
- * @experimental
1242
- * @deprecated
1243
- * @default false
1244
- */
1245
- devDepsScanner?: boolean;
1246
- /**
1247
- * Revert vite build to the v2.9 strategy. Disable esbuild deps optimization and adds `@rollup/plugin-commonjs`
1248
- *
1249
- * @experimental
1250
- * @deprecated
1251
- * @default false
1252
- */
1253
- buildRollupPluginCommonjs?: boolean;
1254
1245
  /**
1255
1246
  * Revert vite build --ssr to the v2.9 strategy. Use CJS SSR build and v2.9 externalization heuristics
1256
1247
  *
@@ -1572,6 +1563,7 @@ export declare interface PluginContainer {
1572
1563
  getModuleInfo(id: string): ModuleInfo | null;
1573
1564
  buildStart(options: InputOptions): Promise<void>;
1574
1565
  resolveId(id: string, importer?: string, options?: {
1566
+ custom?: CustomPluginOptions;
1575
1567
  skip?: Set<Plugin_2>;
1576
1568
  ssr?: boolean;
1577
1569
  /* Excluded from this release type: scan */
@@ -1678,7 +1670,7 @@ export declare type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'asse
1678
1670
  server: ResolvedServerOptions;
1679
1671
  build: ResolvedBuildOptions;
1680
1672
  preview: ResolvedPreviewOptions;
1681
- ssr: ResolvedSSROptions | undefined;
1673
+ ssr: ResolvedSSROptions;
1682
1674
  assetsInclude: (file: string) => boolean;
1683
1675
  logger: Logger;
1684
1676
  createResolver: (options?: Partial<InternalResolveOptions>) => ResolveFn;
@@ -1700,6 +1692,7 @@ export declare interface ResolvedServerOptions extends ServerOptions {
1700
1692
  export declare interface ResolvedSSROptions extends SSROptions {
1701
1693
  target: SSRTarget;
1702
1694
  format: SSRFormat;
1695
+ optimizeDeps: SsrDepOptimizationOptions;
1703
1696
  }
1704
1697
 
1705
1698
  export declare type ResolvedUrl = [
@@ -2013,11 +2006,13 @@ export declare class SplitVendorChunkCache {
2013
2006
 
2014
2007
  export declare function splitVendorChunkPlugin(): Plugin_2;
2015
2008
 
2009
+ export declare type SsrDepOptimizationOptions = DepOptimizationConfig;
2010
+
2016
2011
  export declare type SSRFormat = 'esm' | 'cjs';
2017
2012
 
2018
2013
  export declare interface SSROptions {
2019
- external?: string[];
2020
2014
  noExternal?: string | RegExp | (string | RegExp)[] | true;
2015
+ external?: string[];
2021
2016
  /**
2022
2017
  * Define the target for the ssr build. The browser field in package.json
2023
2018
  * is ignored for node but used if webworker is the target
@@ -2032,6 +2027,15 @@ export declare interface SSROptions {
2032
2027
  * @experimental
2033
2028
  */
2034
2029
  format?: SSRFormat;
2030
+ /**
2031
+ * Control over which dependencies are optimized during SSR and esbuild options
2032
+ * During build:
2033
+ * no external CJS dependencies are optimized by default
2034
+ * During dev:
2035
+ * explicit no external CJS dependencies are optimized by default
2036
+ * @experimental
2037
+ */
2038
+ optimizeDeps?: SsrDepOptimizationOptions;
2035
2039
  }
2036
2040
 
2037
2041
  export declare type SSRTarget = 'node' | 'webworker';
@@ -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-c7f6d0a5.js';
1
+ export { b as build, k as createFilter, u as createLogger, c as createServer, d as defineConfig, f as formatPostcssSourceMap, h as getDepOptimizationConfig, i as isDepsOptimizerEnabled, l as loadConfigFromFile, w as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, p as preview, g as resolveBaseUrl, e as resolveConfig, x as resolveEnvPrefix, a as resolvePackageData, r as resolvePackageEntry, v as searchForWorkspaceRoot, q as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-58325dc2.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.6";
34
+ var version = "3.0.0-beta.9";
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.6",
3
+ "version": "3.0.0-beta.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Evan You",
@@ -101,7 +101,6 @@
101
101
  "micromatch": "^4.0.5",
102
102
  "mlly": "^0.5.4",
103
103
  "mrmime": "^1.0.1",
104
- "node-forge": "^1.3.1",
105
104
  "okie": "^1.0.1",
106
105
  "open": "^8.4.0",
107
106
  "periscopic": "^3.0.4",