vite 2.9.0-beta.10 → 2.9.0-beta.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.

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-7a52803b.js');
3
+ var index = require('./dep-7765b27c.js');
4
4
  var require$$1 = require('crypto');
5
5
  require('fs');
6
6
  require('path');
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-7a52803b.js');
4
+ var index = require('./chunks/dep-7765b27c.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-7a52803b.js'); }).then(function (n) { return n.index$1; });
686
+ const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-7765b27c.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-7a52803b.js'); }).then(function (n) { return n.build$1; });
735
+ const { build } = await Promise.resolve().then(function () { return require('./chunks/dep-7765b27c.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-7a52803b.js'); }).then(function (n) { return n.index; });
758
+ const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-7765b27c.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-7a52803b.js'); }).then(function (n) { return n.preview$1; });
781
+ const { preview } = await Promise.resolve().then(function () { return require('./chunks/dep-7765b27c.js'); }).then(function (n) { return n.preview$1; });
782
782
  try {
783
783
  const server = await preview({
784
784
  root,
@@ -762,7 +762,7 @@ export declare interface HmrContext {
762
762
  export declare interface HmrOptions {
763
763
  protocol?: string;
764
764
  host?: string;
765
- port?: number | false;
765
+ port?: number;
766
766
  clientPort?: number;
767
767
  path?: string;
768
768
  timeout?: number;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./chunks/dep-7a52803b.js');
5
+ var index = require('./chunks/dep-7765b27c.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.10",
3
+ "version": "2.9.0-beta.11",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "Native-ESM powered web dev build tool",
@@ -7,9 +7,10 @@ import '@vite/env'
7
7
 
8
8
  // injected by the hmr plugin when served
9
9
  declare const __BASE__: string
10
- declare const __HMR_PROTOCOL__: string
11
- declare const __HMR_HOSTNAME__: string
12
- declare const __HMR_PORT__: string | false
10
+ declare const __HMR_PROTOCOL__: string | null
11
+ declare const __HMR_HOSTNAME__: string | null
12
+ declare const __HMR_PORT__: string | null
13
+ declare const __HMR_BASE__: string
13
14
  declare const __HMR_TIMEOUT__: number
14
15
  declare const __HMR_ENABLE_OVERLAY__: boolean
15
16
 
@@ -18,9 +19,9 @@ console.log('[vite] connecting...')
18
19
  // use server configuration, then fallback to inference
19
20
  const socketProtocol =
20
21
  __HMR_PROTOCOL__ || (location.protocol === 'https:' ? 'wss' : 'ws')
21
- const socketHost = __HMR_PORT__
22
- ? `${__HMR_HOSTNAME__ || location.hostname}:${__HMR_PORT__}`
23
- : `${__HMR_HOSTNAME__ || location.hostname}`
22
+ const socketHost = `${__HMR_HOSTNAME__ || location.hostname}:${
23
+ __HMR_PORT__ || location.port
24
+ }${__HMR_BASE__}`
24
25
 
25
26
  const socket = new WebSocket(`${socketProtocol}://${socketHost}`, 'vite-hmr')
26
27
  const base = __BASE__ || '/'