vite 2.9.0-beta.6 → 2.9.0-beta.7

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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./dep-7a3b37e3.js');
3
+ var index = require('./dep-0e100549.js');
4
4
  var require$$1 = require('crypto');
5
5
  require('fs');
6
6
  require('path');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('postcss');
4
- var index$1 = require('./dep-7a3b37e3.js');
4
+ var index$1 = require('./dep-0e100549.js');
5
5
  var path$2 = require('path');
6
6
  var require$$1 = require('crypto');
7
7
  var fs = require('fs');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./dep-7a3b37e3.js');
3
+ var index = require('./dep-0e100549.js');
4
4
 
5
5
  function _mergeNamespaces(n, m) {
6
6
  for (var i = 0; i < m.length; i++) {
package/dist/node/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('events');
4
- var index = require('./chunks/dep-7a3b37e3.js');
4
+ var index = require('./chunks/dep-0e100549.js');
5
5
  var perf_hooks = require('perf_hooks');
6
6
  require('fs');
7
7
  require('path');
@@ -683,7 +683,7 @@ cli
683
683
  .action(async (root, options) => {
684
684
  // output structure is preserved even after bundling so require()
685
685
  // is ok here
686
- const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-7a3b37e3.js'); }).then(function (n) { return n.index$1; });
686
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-0e100549.js'); }).then(function (n) { return n.index$1; });
687
687
  try {
688
688
  const server = await createServer({
689
689
  root,
@@ -732,7 +732,7 @@ cli
732
732
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
733
733
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
734
734
  .action(async (root, options) => {
735
- const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-7a3b37e3.js'); }).then(function (n) { return n.build$1; });
735
+ const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-0e100549.js'); }).then(function (n) { return n.build$1; });
736
736
  const buildOptions = cleanOptions(options);
737
737
  try {
738
738
  await build({
@@ -755,7 +755,7 @@ cli
755
755
  .command('optimize [root]', 'pre-bundle dependencies')
756
756
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
757
757
  .action(async (root, options) => {
758
- const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-7a3b37e3.js'); }).then(function (n) { return n.index; });
758
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-0e100549.js'); }).then(function (n) { return n.index; });
759
759
  try {
760
760
  const config = await index.resolveConfig({
761
761
  root,
@@ -778,7 +778,7 @@ cli
778
778
  .option('--https', `[boolean] use TLS + HTTP/2`)
779
779
  .option('--open [path]', `[boolean | string] open browser on startup`)
780
780
  .action(async (root, options) => {
781
- const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-7a3b37e3.js'); }).then(function (n) { return n.preview$1; });
781
+ const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-0e100549.js'); }).then(function (n) { return n.preview$1; });
782
782
  try {
783
783
  const server = await preview({
784
784
  root,
@@ -525,6 +525,10 @@ export declare interface DepOptimizationMetadata {
525
525
  * Metadata for each newly discovered dependency after processing
526
526
  */
527
527
  discovered: Record<string, OptimizedDepInfo>;
528
+ /**
529
+ * OptimizedDepInfo list
530
+ */
531
+ depInfoList: OptimizedDepInfo[];
528
532
  }
529
533
 
530
534
  export declare interface DepOptimizationOptions {
@@ -584,17 +588,11 @@ export declare interface DepOptimizationProcessing {
584
588
  }
585
589
 
586
590
  export declare interface DepOptimizationResult {
587
- /**
588
- * After a re-optimization, the internal bundled chunks may change
589
- * and a full page reload is required if that is the case
590
- * If the files are stable, we can avoid the reload that is expensive
591
- * for large applications
592
- */
593
- alteredFiles: boolean;
591
+ metadata: DepOptimizationMetadata;
594
592
  /**
595
593
  * When doing a re-run, if there are newly discovered dependendencies
596
- * the page reload will be delayed until the next rerun so the
597
- * result will be discarded
594
+ * the page reload will be delayed until the next rerun so we need
595
+ * to be able to discard the result
598
596
  */
599
597
  commit: () => void;
600
598
  cancel: () => void;
@@ -1049,6 +1047,7 @@ export declare interface InternalResolveOptions extends ResolveOptions {
1049
1047
  isRequire?: boolean;
1050
1048
  isFromTsImporter?: boolean;
1051
1049
  tryEsmOnly?: boolean;
1050
+ scan?: boolean;
1052
1051
  }
1053
1052
 
1054
1053
  export declare interface JsonOptions {
@@ -1180,8 +1179,9 @@ export declare class ModuleNode {
1180
1179
  export declare function normalizePath(id: string): string;
1181
1180
 
1182
1181
  export declare interface OptimizedDepInfo {
1182
+ id: string;
1183
1183
  file: string;
1184
- src: string;
1184
+ src?: string;
1185
1185
  needsInterop?: boolean;
1186
1186
  browserHash?: string;
1187
1187
  fileHash?: string;
@@ -1192,11 +1192,16 @@ export declare interface OptimizedDepInfo {
1192
1192
  processing?: Promise<void>;
1193
1193
  }
1194
1194
 
1195
+ export declare interface OptimizedDeps {
1196
+ metadata: DepOptimizationMetadata;
1197
+ scanProcessing?: Promise<void>;
1198
+ registerMissingImport: (id: string, resolved: string) => OptimizedDepInfo;
1199
+ }
1200
+
1195
1201
  /**
1196
1202
  * Used by Vite CLI when running `vite optimize`
1197
1203
  */
1198
- export declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean, newDeps?: Record<string, OptimizedDepInfo>, // missing imports encountered after server has started
1199
- ssr?: boolean): Promise<DepOptimizationMetadata>;
1204
+ export declare function optimizeDeps(config: ResolvedConfig, force?: boolean | undefined, asCommand?: boolean): Promise<DepOptimizationMetadata>;
1200
1205
 
1201
1206
  /** Cache for package.json resolution and package.json contents */
1202
1207
  export declare type PackageCache = Map<string, PackageData>;
@@ -1319,6 +1324,7 @@ export declare interface Plugin extends Plugin_2 {
1319
1324
  resolveId?(this: PluginContext, source: string, importer: string | undefined, options: {
1320
1325
  custom?: CustomPluginOptions;
1321
1326
  ssr?: boolean;
1327
+ /* Excluded from this release type: scan */
1322
1328
  }): Promise<ResolveIdResult> | ResolveIdResult;
1323
1329
  load?(this: PluginContext, id: string, options?: {
1324
1330
  ssr?: boolean;
@@ -1335,6 +1341,7 @@ export declare interface PluginContainer {
1335
1341
  resolveId(id: string, importer?: string, options?: {
1336
1342
  skip?: Set<Plugin>;
1337
1343
  ssr?: boolean;
1344
+ /* Excluded from this release type: scan */
1338
1345
  }): Promise<PartialResolvedId | null>;
1339
1346
  transform(code: string, id: string, options?: {
1340
1347
  inMap?: SourceDescription['map'];
@@ -2195,12 +2202,11 @@ export declare interface ViteDevServer {
2195
2202
  * @param forceOptimize - force the optimizer to re-bundle, same as --force cli flag
2196
2203
  */
2197
2204
  restart(forceOptimize?: boolean): Promise<void>;
2198
- /* Excluded from this release type: _optimizeDepsMetadata */
2205
+ /* Excluded from this release type: _optimizedDeps */
2199
2206
  /* Excluded from this release type: _ssrExternals */
2200
2207
  /* Excluded from this release type: _globImporters */
2201
2208
  /* Excluded from this release type: _restartPromise */
2202
2209
  /* Excluded from this release type: _forceOptimizeOnRestart */
2203
- /* Excluded from this release type: _registerMissingImport */
2204
2210
  /* Excluded from this release type: _pendingRequests */
2205
2211
  }
2206
2212
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./chunks/dep-7a3b37e3.js');
5
+ var index = require('./chunks/dep-0e100549.js');
6
6
  require('fs');
7
7
  require('path');
8
8
  require('tty');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite",
3
- "version": "2.9.0-beta.6",
3
+ "version": "2.9.0-beta.7",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",