vite 3.0.0-alpha.7 → 3.0.0-alpha.8

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,4 +1,4 @@
1
- import { w as commonjsGlobal } from './dep-e214e00e.js';
1
+ import { w as commonjsGlobal } from './dep-8250f392.js';
2
2
  import require$$1 from 'crypto';
3
3
  import 'fs';
4
4
  import 'path';
@@ -1,4 +1,4 @@
1
- import { x as getAugmentedNamespace, y as getDefaultExportFromCjs } from './dep-e214e00e.js';
1
+ import { x as getAugmentedNamespace, y as getDefaultExportFromCjs } from './dep-8250f392.js';
2
2
 
3
3
  import { fileURLToPath as __cjs_fileURLToPath } from 'url';
4
4
  import { dirname as __cjs_dirname } from 'path';
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-e214e00e.js';
3
+ import { v as colors, j as createLogger, e as resolveConfig } from './chunks/dep-8250f392.js';
4
4
  import { VERSION } from './constants.js';
5
5
  import 'fs';
6
6
  import 'path';
@@ -682,7 +682,7 @@ cli
682
682
  .action(async (root, options) => {
683
683
  // output structure is preserved even after bundling so require()
684
684
  // is ok here
685
- const { createServer } = await import('./chunks/dep-e214e00e.js').then(function (n) { return n.B; });
685
+ const { createServer } = await import('./chunks/dep-8250f392.js').then(function (n) { return n.B; });
686
686
  try {
687
687
  const server = await createServer({
688
688
  root,
@@ -728,7 +728,7 @@ cli
728
728
  .option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
729
729
  .option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
730
730
  .action(async (root, options) => {
731
- const { build } = await import('./chunks/dep-e214e00e.js').then(function (n) { return n.A; });
731
+ const { build } = await import('./chunks/dep-8250f392.js').then(function (n) { return n.A; });
732
732
  const buildOptions = cleanOptions(options);
733
733
  try {
734
734
  await build({
@@ -752,7 +752,7 @@ cli
752
752
  .command('optimize [root]', 'pre-bundle dependencies')
753
753
  .option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
754
754
  .action(async (root, options) => {
755
- const { optimizeDeps } = await import('./chunks/dep-e214e00e.js').then(function (n) { return n.z; });
755
+ const { optimizeDeps } = await import('./chunks/dep-8250f392.js').then(function (n) { return n.z; });
756
756
  try {
757
757
  const config = await resolveConfig({
758
758
  root,
@@ -775,7 +775,7 @@ cli
775
775
  .option('--https', `[boolean] use TLS + HTTP/2`)
776
776
  .option('--open [path]', `[boolean | string] open browser on startup`)
777
777
  .action(async (root, options) => {
778
- const { preview } = await import('./chunks/dep-e214e00e.js').then(function (n) { return n.C; });
778
+ const { preview } = await import('./chunks/dep-8250f392.js').then(function (n) { return n.C; });
779
779
  try {
780
780
  const server = await preview({
781
781
  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.7";
4
+ var version = "3.0.0-alpha.8";
5
5
 
6
6
  const VERSION = version;
7
7
  const DEFAULT_MAIN_FIELDS = [
@@ -1165,6 +1165,7 @@ export declare interface InternalResolveOptions extends ResolveOptions {
1165
1165
  tryEsmOnly?: boolean;
1166
1166
  scan?: boolean;
1167
1167
  getDepsOptimizer?: () => DepsOptimizer | undefined;
1168
+ shouldExternalize?: (id: string) => boolean | undefined;
1168
1169
  }
1169
1170
 
1170
1171
  export declare function isDepsOptimizerEnabled(config: ResolvedConfig): boolean;
@@ -1192,9 +1193,25 @@ export declare interface KnownAsTypeMap {
1192
1193
  export declare type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife';
1193
1194
 
1194
1195
  export declare interface LibraryOptions {
1196
+ /**
1197
+ * Path of library entry
1198
+ */
1195
1199
  entry: string;
1200
+ /**
1201
+ * The name of the exposed global variable. Required when the `formats` option includes
1202
+ * `umd` or `iife`
1203
+ */
1196
1204
  name?: string;
1205
+ /**
1206
+ * Output bundle formats
1207
+ * @default ['es', 'umd']
1208
+ */
1197
1209
  formats?: LibraryFormats[];
1210
+ /**
1211
+ * The name of the package file output. The default file name is the name option
1212
+ * of the project package.json. It can also be defined as a function taking the
1213
+ * format as an argument.
1214
+ */
1198
1215
  fileName?: string | ((format: ModuleFormat) => string);
1199
1216
  }
1200
1217
 
@@ -1885,6 +1902,8 @@ export declare class SplitVendorChunkCache {
1885
1902
 
1886
1903
  export declare function splitVendorChunkPlugin(): Plugin_2;
1887
1904
 
1905
+ export declare type SSRFormat = 'esm' | 'cjs';
1906
+
1888
1907
  export declare interface SSROptions {
1889
1908
  external?: string[];
1890
1909
  noExternal?: string | RegExp | (string | RegExp)[] | true;
@@ -1894,6 +1913,14 @@ export declare interface SSROptions {
1894
1913
  * Default: 'node'
1895
1914
  */
1896
1915
  target?: SSRTarget;
1916
+ /**
1917
+ * Define the format for the ssr build. Since Vite v3 the SSR build generates ESM by default.
1918
+ * `'cjs'` can be selected to generate a CJS build, but it isn't recommended. This option is
1919
+ * left marked as experimental to give users more time to update to ESM. CJS builds requires
1920
+ * complex externalization heuristics that aren't present in the ESM format.
1921
+ * @experimental
1922
+ */
1923
+ format?: SSRFormat;
1897
1924
  }
1898
1925
 
1899
1926
  export declare type SSRTarget = 'node' | 'webworker';
@@ -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-e214e00e.js';
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-8250f392.js';
2
2
  import 'fs';
3
3
  import 'path';
4
4
  import 'url';
@@ -1256,7 +1256,7 @@ function lookupFile(dir, formats, options) {
1256
1256
  }
1257
1257
  }
1258
1258
  /**
1259
- * Use instead of fs.existsSync(filename)
1259
+ * Use fs.statSync(filename) instead of fs.existsSync(filename)
1260
1260
  * #2051 if we don't have read permission on a directory, existsSync() still
1261
1261
  * works and will result in massively slow subsequent checks (which are
1262
1262
  * unnecessary in the first place)