vite 2.4.0 → 2.4.1
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.
- package/CHANGELOG.md +10 -0
- package/LICENSE.md +95 -0
- package/client.d.ts +1 -1
- package/dist/node/chunks/{dep-e1f3e4b2.js → dep-7db2a04d.js} +14 -8
- package/dist/node/chunks/dep-7db2a04d.js.map +1 -0
- package/dist/node/chunks/{dep-7e728e80.js → dep-b2288281.js} +2 -2
- package/dist/node/chunks/{dep-7e728e80.js.map → dep-b2288281.js.map} +1 -1
- package/dist/node/chunks/{dep-7ad271e1.js → dep-cb9bf5e2.js} +2 -2
- package/dist/node/chunks/{dep-7ad271e1.js.map → dep-cb9bf5e2.js.map} +1 -1
- package/dist/node/chunks/{dep-fc2895ac.js → dep-cc49d7be.js} +233 -84
- package/dist/node/chunks/dep-cc49d7be.js.map +1 -0
- package/dist/node/chunks/{dep-fb883aba.js → dep-d25c0094.js} +2 -2
- package/dist/node/chunks/{dep-fb883aba.js.map → dep-d25c0094.js.map} +1 -1
- package/dist/node/cli.js +4 -4
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +1 -1
- package/package.json +8 -8
- package/src/node/optimizer/index.ts +0 -5
- package/src/node/plugins/css.ts +1 -1
- package/src/node/server/hmr.ts +5 -5
- package/src/node/server/openBrowser.ts +1 -1
- package/dist/node/chunks/dep-e1f3e4b2.js.map +0 -1
- package/dist/node/chunks/dep-fc2895ac.js.map +0 -1
|
@@ -24,7 +24,7 @@ var require$$4 = require('vm');
|
|
|
24
24
|
var require$$7 = require('console');
|
|
25
25
|
var esbuild = require('esbuild');
|
|
26
26
|
var require$$1$3 = require('worker_threads');
|
|
27
|
-
var require$$
|
|
27
|
+
var require$$1$5 = require('child_process');
|
|
28
28
|
var readline = require('readline');
|
|
29
29
|
|
|
30
30
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
@@ -66,7 +66,7 @@ var require$$3__default = /*#__PURE__*/_interopDefaultLegacy(require$$3$1);
|
|
|
66
66
|
var require$$4__default = /*#__PURE__*/_interopDefaultLegacy(require$$4);
|
|
67
67
|
var require$$7__default = /*#__PURE__*/_interopDefaultLegacy(require$$7);
|
|
68
68
|
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1$3);
|
|
69
|
-
var require$$
|
|
69
|
+
var require$$1__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$1$5);
|
|
70
70
|
var readline__default = /*#__PURE__*/_interopDefaultLegacy(readline);
|
|
71
71
|
|
|
72
72
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -27923,7 +27923,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
27923
27923
|
replacer: urlReplacer
|
|
27924
27924
|
}));
|
|
27925
27925
|
if (isModule) {
|
|
27926
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
27926
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-b2288281.js'); }).then(function (n) { return n.index; })).default({
|
|
27927
27927
|
...modulesOptions,
|
|
27928
27928
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
27929
27929
|
modules = _modules;
|
|
@@ -28088,7 +28088,7 @@ async function doUrlReplace(rawUrl, matched, replacer) {
|
|
|
28088
28088
|
}
|
|
28089
28089
|
let CleanCSS;
|
|
28090
28090
|
async function minifyCSS(css, config) {
|
|
28091
|
-
CleanCSS = CleanCSS || (await Promise.resolve().then(function () { return require('./dep-
|
|
28091
|
+
CleanCSS = CleanCSS || (await Promise.resolve().then(function () { return require('./dep-cb9bf5e2.js'); }).then(function (n) { return n.index; })).default;
|
|
28092
28092
|
const res = new CleanCSS({
|
|
28093
28093
|
rebase: false,
|
|
28094
28094
|
...config.build.cleanCssOptions
|
|
@@ -28861,7 +28861,7 @@ const assetAttrsConfig = {
|
|
|
28861
28861
|
};
|
|
28862
28862
|
async function traverseHtml(html, filePath, visitor) {
|
|
28863
28863
|
// lazy load compiler
|
|
28864
|
-
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-
|
|
28864
|
+
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-7db2a04d.js'); }).then(function (n) { return n.compilerDom_cjs; });
|
|
28865
28865
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
28866
28866
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
28867
28867
|
try {
|
|
@@ -36315,7 +36315,7 @@ var dirGlob$1 = {exports: {}};
|
|
|
36315
36315
|
|
|
36316
36316
|
var pathType$1 = {};
|
|
36317
36317
|
|
|
36318
|
-
const {promisify: promisify$
|
|
36318
|
+
const {promisify: promisify$6} = require$$0__default$3;
|
|
36319
36319
|
const fs$e = fs__default;
|
|
36320
36320
|
|
|
36321
36321
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
@@ -36324,7 +36324,7 @@ async function isType(fsStatType, statsMethodName, filePath) {
|
|
|
36324
36324
|
}
|
|
36325
36325
|
|
|
36326
36326
|
try {
|
|
36327
|
-
const stats = await promisify$
|
|
36327
|
+
const stats = await promisify$6(fs$e[fsStatType])(filePath);
|
|
36328
36328
|
return stats[statsMethodName]();
|
|
36329
36329
|
} catch (error) {
|
|
36330
36330
|
if (error.code === 'ENOENT') {
|
|
@@ -37044,7 +37044,7 @@ var slash$1 = path => {
|
|
|
37044
37044
|
return path.replace(/\\/g, '/');
|
|
37045
37045
|
};
|
|
37046
37046
|
|
|
37047
|
-
const {promisify: promisify$
|
|
37047
|
+
const {promisify: promisify$5} = require$$0__default$3;
|
|
37048
37048
|
const fs$d = fs__default;
|
|
37049
37049
|
const path$b = path__default;
|
|
37050
37050
|
const fastGlob$1 = out;
|
|
@@ -37058,7 +37058,7 @@ const DEFAULT_IGNORE = [
|
|
|
37058
37058
|
'**/.git'
|
|
37059
37059
|
];
|
|
37060
37060
|
|
|
37061
|
-
const readFileP = promisify$
|
|
37061
|
+
const readFileP = promisify$5(fs$d.readFile);
|
|
37062
37062
|
|
|
37063
37063
|
const mapGitIgnorePatternTo = base => ignore => {
|
|
37064
37064
|
if (ignore.startsWith('!')) {
|
|
@@ -54642,13 +54642,13 @@ var chokidar = {};
|
|
|
54642
54642
|
const fs$b = fs__default;
|
|
54643
54643
|
const { Readable } = require$$0__default$2;
|
|
54644
54644
|
const sysPath$3 = path__default;
|
|
54645
|
-
const { promisify: promisify$
|
|
54645
|
+
const { promisify: promisify$4 } = require$$0__default$3;
|
|
54646
54646
|
const picomatch$1 = picomatch$4;
|
|
54647
54647
|
|
|
54648
|
-
const readdir$1 = promisify$
|
|
54649
|
-
const stat$3 = promisify$
|
|
54650
|
-
const lstat$2 = promisify$
|
|
54651
|
-
const realpath$1 = promisify$
|
|
54648
|
+
const readdir$1 = promisify$4(fs$b.readdir);
|
|
54649
|
+
const stat$3 = promisify$4(fs$b.stat);
|
|
54650
|
+
const lstat$2 = promisify$4(fs$b.lstat);
|
|
54651
|
+
const realpath$1 = promisify$4(fs$b.realpath);
|
|
54652
54652
|
|
|
54653
54653
|
/**
|
|
54654
54654
|
* @typedef {Object} EntryInfo
|
|
@@ -55407,7 +55407,7 @@ exports.isIBMi = os.type() === 'OS400';
|
|
|
55407
55407
|
|
|
55408
55408
|
const fs$a = fs__default;
|
|
55409
55409
|
const sysPath$2 = path__default;
|
|
55410
|
-
const { promisify: promisify$
|
|
55410
|
+
const { promisify: promisify$3 } = require$$0__default$3;
|
|
55411
55411
|
const isBinaryPath = isBinaryPath$1;
|
|
55412
55412
|
const {
|
|
55413
55413
|
isWindows: isWindows$2,
|
|
@@ -55430,11 +55430,11 @@ const {
|
|
|
55430
55430
|
|
|
55431
55431
|
const THROTTLE_MODE_WATCH = 'watch';
|
|
55432
55432
|
|
|
55433
|
-
const open$1 = promisify$
|
|
55434
|
-
const stat$2 = promisify$
|
|
55435
|
-
const lstat$1 = promisify$
|
|
55436
|
-
const close = promisify$
|
|
55437
|
-
const fsrealpath = promisify$
|
|
55433
|
+
const open$1 = promisify$3(fs$a.open);
|
|
55434
|
+
const stat$2 = promisify$3(fs$a.stat);
|
|
55435
|
+
const lstat$1 = promisify$3(fs$a.lstat);
|
|
55436
|
+
const close = promisify$3(fs$a.close);
|
|
55437
|
+
const fsrealpath = promisify$3(fs$a.realpath);
|
|
55438
55438
|
|
|
55439
55439
|
const statMethods$1 = { lstat: lstat$1, stat: stat$2 };
|
|
55440
55440
|
|
|
@@ -56044,7 +56044,7 @@ var fseventsHandler = {exports: {}};
|
|
|
56044
56044
|
|
|
56045
56045
|
const fs$9 = fs__default;
|
|
56046
56046
|
const sysPath$1 = path__default;
|
|
56047
|
-
const { promisify: promisify$
|
|
56047
|
+
const { promisify: promisify$2 } = require$$0__default$3;
|
|
56048
56048
|
|
|
56049
56049
|
let fsevents;
|
|
56050
56050
|
try {
|
|
@@ -56093,9 +56093,9 @@ const {
|
|
|
56093
56093
|
|
|
56094
56094
|
const Depth = (value) => isNaN(value) ? {} : {depth: value};
|
|
56095
56095
|
|
|
56096
|
-
const stat$1 = promisify$
|
|
56097
|
-
const lstat = promisify$
|
|
56098
|
-
const realpath = promisify$
|
|
56096
|
+
const stat$1 = promisify$2(fs$9.stat);
|
|
56097
|
+
const lstat = promisify$2(fs$9.lstat);
|
|
56098
|
+
const realpath = promisify$2(fs$9.realpath);
|
|
56099
56099
|
|
|
56100
56100
|
const statMethods = { stat: stat$1, lstat };
|
|
56101
56101
|
|
|
@@ -56568,7 +56568,7 @@ fseventsHandler.exports.canUse = canUse;
|
|
|
56568
56568
|
const { EventEmitter: EventEmitter$2 } = require$$0__default$6;
|
|
56569
56569
|
const fs$8 = fs__default;
|
|
56570
56570
|
const sysPath = path__default;
|
|
56571
|
-
const { promisify: promisify$
|
|
56571
|
+
const { promisify: promisify$1 } = require$$0__default$3;
|
|
56572
56572
|
const readdirp = readdirp_1;
|
|
56573
56573
|
const anymatch = anymatch$2.exports.default;
|
|
56574
56574
|
const globParent = globParent$3;
|
|
@@ -56617,8 +56617,8 @@ const {
|
|
|
56617
56617
|
isIBMi
|
|
56618
56618
|
} = constants$1;
|
|
56619
56619
|
|
|
56620
|
-
const stat = promisify$
|
|
56621
|
-
const readdir = promisify$
|
|
56620
|
+
const stat = promisify$1(fs$8.stat);
|
|
56621
|
+
const readdir = promisify$1(fs$8.readdir);
|
|
56622
56622
|
|
|
56623
56623
|
/**
|
|
56624
56624
|
* @typedef {String} Path
|
|
@@ -57588,7 +57588,7 @@ function readFileIfExists(value) {
|
|
|
57588
57588
|
* https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
|
|
57589
57589
|
*/
|
|
57590
57590
|
async function createCertificate() {
|
|
57591
|
-
const { generate } = await Promise.resolve().then(function () { return require('./dep-
|
|
57591
|
+
const { generate } = await Promise.resolve().then(function () { return require('./dep-d25c0094.js'); }).then(function (n) { return n.index; });
|
|
57592
57592
|
const pems = generate(null, {
|
|
57593
57593
|
algorithm: 'sha256',
|
|
57594
57594
|
days: 30,
|
|
@@ -60120,7 +60120,13 @@ class WebSocket$2 extends EventEmitter$1 {
|
|
|
60120
60120
|
}
|
|
60121
60121
|
|
|
60122
60122
|
if (this.readyState === WebSocket$2.CLOSING) {
|
|
60123
|
-
if (
|
|
60123
|
+
if (
|
|
60124
|
+
this._closeFrameSent &&
|
|
60125
|
+
(this._closeFrameReceived || this._receiver._writableState.errorEmitted)
|
|
60126
|
+
) {
|
|
60127
|
+
this._socket.end();
|
|
60128
|
+
}
|
|
60129
|
+
|
|
60124
60130
|
return;
|
|
60125
60131
|
}
|
|
60126
60132
|
|
|
@@ -60133,7 +60139,13 @@ class WebSocket$2 extends EventEmitter$1 {
|
|
|
60133
60139
|
if (err) return;
|
|
60134
60140
|
|
|
60135
60141
|
this._closeFrameSent = true;
|
|
60136
|
-
|
|
60142
|
+
|
|
60143
|
+
if (
|
|
60144
|
+
this._closeFrameReceived ||
|
|
60145
|
+
this._receiver._writableState.errorEmitted
|
|
60146
|
+
) {
|
|
60147
|
+
this._socket.end();
|
|
60148
|
+
}
|
|
60137
60149
|
});
|
|
60138
60150
|
|
|
60139
60151
|
//
|
|
@@ -60543,22 +60555,50 @@ function initAsClient(websocket, address, protocols, options) {
|
|
|
60543
60555
|
|
|
60544
60556
|
if (serverProt) websocket._protocol = serverProt;
|
|
60545
60557
|
|
|
60546
|
-
|
|
60558
|
+
const secWebSocketExtensions = res.headers['sec-websocket-extensions'];
|
|
60559
|
+
|
|
60560
|
+
if (secWebSocketExtensions !== undefined) {
|
|
60561
|
+
if (!perMessageDeflate) {
|
|
60562
|
+
const message =
|
|
60563
|
+
'Server sent a Sec-WebSocket-Extensions header but no extension ' +
|
|
60564
|
+
'was requested';
|
|
60565
|
+
abortHandshake$1(websocket, socket, message);
|
|
60566
|
+
return;
|
|
60567
|
+
}
|
|
60568
|
+
|
|
60569
|
+
let extensions;
|
|
60570
|
+
|
|
60547
60571
|
try {
|
|
60548
|
-
|
|
60572
|
+
extensions = parse$7(secWebSocketExtensions);
|
|
60573
|
+
} catch (err) {
|
|
60574
|
+
const message = 'Invalid Sec-WebSocket-Extensions header';
|
|
60575
|
+
abortHandshake$1(websocket, socket, message);
|
|
60576
|
+
return;
|
|
60577
|
+
}
|
|
60549
60578
|
|
|
60550
|
-
|
|
60579
|
+
const extensionNames = Object.keys(extensions);
|
|
60580
|
+
|
|
60581
|
+
if (extensionNames.length) {
|
|
60582
|
+
if (
|
|
60583
|
+
extensionNames.length !== 1 ||
|
|
60584
|
+
extensionNames[0] !== PerMessageDeflate$1.extensionName
|
|
60585
|
+
) {
|
|
60586
|
+
const message =
|
|
60587
|
+
'Server indicated an extension that was not requested';
|
|
60588
|
+
abortHandshake$1(websocket, socket, message);
|
|
60589
|
+
return;
|
|
60590
|
+
}
|
|
60591
|
+
|
|
60592
|
+
try {
|
|
60551
60593
|
perMessageDeflate.accept(extensions[PerMessageDeflate$1.extensionName]);
|
|
60552
|
-
|
|
60553
|
-
|
|
60594
|
+
} catch (err) {
|
|
60595
|
+
const message = 'Invalid Sec-WebSocket-Extensions header';
|
|
60596
|
+
abortHandshake$1(websocket, socket, message);
|
|
60597
|
+
return;
|
|
60554
60598
|
}
|
|
60555
|
-
|
|
60556
|
-
|
|
60557
|
-
|
|
60558
|
-
socket,
|
|
60559
|
-
'Invalid Sec-WebSocket-Extensions header'
|
|
60560
|
-
);
|
|
60561
|
-
return;
|
|
60599
|
+
|
|
60600
|
+
websocket._extensions[PerMessageDeflate$1.extensionName] =
|
|
60601
|
+
perMessageDeflate;
|
|
60562
60602
|
}
|
|
60563
60603
|
}
|
|
60564
60604
|
|
|
@@ -60919,13 +60959,13 @@ function createWebSocketStream(ws, options) {
|
|
|
60919
60959
|
|
|
60920
60960
|
// Prevent `ws.terminate()` from being called by `duplex._destroy()`.
|
|
60921
60961
|
//
|
|
60922
|
-
// - If the
|
|
60923
|
-
// `ws.terminate()` is a noop as no socket
|
|
60924
|
-
// - Otherwise, the error
|
|
60962
|
+
// - If the `'error'` event is emitted before the `'open'` event, then
|
|
60963
|
+
// `ws.terminate()` is a noop as no socket is assigned.
|
|
60964
|
+
// - Otherwise, the error is re-emitted by the listener of the `'error'`
|
|
60925
60965
|
// event of the `Receiver` object. The listener already closes the
|
|
60926
60966
|
// connection by calling `ws.close()`. This allows a close frame to be
|
|
60927
60967
|
// sent to the other peer. If `ws.terminate()` is called right after this,
|
|
60928
|
-
// the close frame might not be sent.
|
|
60968
|
+
// then the close frame might not be sent.
|
|
60929
60969
|
terminateOnDestroy = false;
|
|
60930
60970
|
duplex.destroy(err);
|
|
60931
60971
|
});
|
|
@@ -66640,7 +66680,7 @@ function propagateUpdate(node, timestamp, boundaries, currentChain = [node]) {
|
|
|
66640
66680
|
// additionally check for CSS importers, since a PostCSS plugin like
|
|
66641
66681
|
// Tailwind JIT may register any file as a dependency to a CSS file.
|
|
66642
66682
|
for (const importer of node.importers) {
|
|
66643
|
-
if (
|
|
66683
|
+
if (cssLangRE.test(importer.url) && !currentChain.includes(importer)) {
|
|
66644
66684
|
propagateUpdate(importer, timestamp, boundaries, currentChain.concat(importer));
|
|
66645
66685
|
}
|
|
66646
66686
|
}
|
|
@@ -66652,8 +66692,8 @@ function propagateUpdate(node, timestamp, boundaries, currentChain = [node]) {
|
|
|
66652
66692
|
// #3716, #3913
|
|
66653
66693
|
// For a non-CSS file, if all of its importers are CSS files (registered via
|
|
66654
66694
|
// PostCSS plugins) it should be considered a dead end and force full reload.
|
|
66655
|
-
if (!
|
|
66656
|
-
[...node.importers].every((i) =>
|
|
66695
|
+
if (!cssLangRE.test(node.url) &&
|
|
66696
|
+
[...node.importers].every((i) => cssLangRE.test(i.url))) {
|
|
66657
66697
|
return true;
|
|
66658
66698
|
}
|
|
66659
66699
|
for (const importer of node.importers) {
|
|
@@ -66947,19 +66987,37 @@ if (process.env.__IS_WSL_TEST__) {
|
|
|
66947
66987
|
isWsl$2.exports = isWsl$1();
|
|
66948
66988
|
}
|
|
66949
66989
|
|
|
66950
|
-
|
|
66990
|
+
var defineLazyProp = (object, propertyName, fn) => {
|
|
66991
|
+
const define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});
|
|
66992
|
+
|
|
66993
|
+
Object.defineProperty(object, propertyName, {
|
|
66994
|
+
configurable: true,
|
|
66995
|
+
enumerable: true,
|
|
66996
|
+
get() {
|
|
66997
|
+
const result = fn();
|
|
66998
|
+
define(result);
|
|
66999
|
+
return result;
|
|
67000
|
+
},
|
|
67001
|
+
set(value) {
|
|
67002
|
+
define(value);
|
|
67003
|
+
}
|
|
67004
|
+
});
|
|
67005
|
+
|
|
67006
|
+
return object;
|
|
67007
|
+
};
|
|
67008
|
+
|
|
66951
67009
|
const path$9 = path__default;
|
|
66952
|
-
const childProcess$3 = require$$
|
|
66953
|
-
const fs$5 = fs__default;
|
|
67010
|
+
const childProcess$3 = require$$1__default$3;
|
|
67011
|
+
const {promises: fs$5, constants: fsConstants} = fs__default;
|
|
66954
67012
|
const isWsl = isWsl$2.exports;
|
|
66955
67013
|
const isDocker = isDocker_1;
|
|
66956
|
-
|
|
66957
|
-
const pAccess = promisify$1(fs$5.access);
|
|
66958
|
-
const pReadFile = promisify$1(fs$5.readFile);
|
|
67014
|
+
const defineLazyProperty = defineLazyProp;
|
|
66959
67015
|
|
|
66960
67016
|
// Path to included `xdg-open`.
|
|
66961
67017
|
const localXdgOpenPath = path$9.join(__dirname, 'xdg-open');
|
|
66962
67018
|
|
|
67019
|
+
const {platform, arch} = process;
|
|
67020
|
+
|
|
66963
67021
|
/**
|
|
66964
67022
|
Get the mount point for fixed drives in WSL.
|
|
66965
67023
|
|
|
@@ -66983,29 +67041,43 @@ const getWslDrivesMountPoint = (() => {
|
|
|
66983
67041
|
|
|
66984
67042
|
let isConfigFileExists = false;
|
|
66985
67043
|
try {
|
|
66986
|
-
await
|
|
67044
|
+
await fs$5.access(configFilePath, fsConstants.F_OK);
|
|
66987
67045
|
isConfigFileExists = true;
|
|
66988
|
-
} catch
|
|
67046
|
+
} catch {}
|
|
66989
67047
|
|
|
66990
67048
|
if (!isConfigFileExists) {
|
|
66991
67049
|
return defaultMountPoint;
|
|
66992
67050
|
}
|
|
66993
67051
|
|
|
66994
|
-
const configContent = await
|
|
66995
|
-
const configMountPoint = /root\s*=\s*(
|
|
67052
|
+
const configContent = await fs$5.readFile(configFilePath, {encoding: 'utf8'});
|
|
67053
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
66996
67054
|
|
|
66997
67055
|
if (!configMountPoint) {
|
|
66998
67056
|
return defaultMountPoint;
|
|
66999
67057
|
}
|
|
67000
67058
|
|
|
67001
|
-
mountPoint = configMountPoint
|
|
67002
|
-
mountPoint = mountPoint.endsWith('/') ? mountPoint : mountPoint
|
|
67059
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
67060
|
+
mountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;
|
|
67003
67061
|
|
|
67004
67062
|
return mountPoint;
|
|
67005
67063
|
};
|
|
67006
67064
|
})();
|
|
67007
67065
|
|
|
67008
|
-
|
|
67066
|
+
const pTryEach = async (array, mapper) => {
|
|
67067
|
+
let latestError;
|
|
67068
|
+
|
|
67069
|
+
for (const item of array) {
|
|
67070
|
+
try {
|
|
67071
|
+
return await mapper(item); // eslint-disable-line no-await-in-loop
|
|
67072
|
+
} catch (error) {
|
|
67073
|
+
latestError = error;
|
|
67074
|
+
}
|
|
67075
|
+
}
|
|
67076
|
+
|
|
67077
|
+
throw latestError;
|
|
67078
|
+
};
|
|
67079
|
+
|
|
67080
|
+
const open = async (target, options) => {
|
|
67009
67081
|
if (typeof target !== 'string') {
|
|
67010
67082
|
throw new TypeError('Expected a `target`');
|
|
67011
67083
|
}
|
|
@@ -67013,22 +67085,36 @@ var open = async (target, options) => {
|
|
|
67013
67085
|
options = {
|
|
67014
67086
|
wait: false,
|
|
67015
67087
|
background: false,
|
|
67088
|
+
newInstance: false,
|
|
67016
67089
|
allowNonzeroExitCode: false,
|
|
67017
67090
|
...options
|
|
67018
67091
|
};
|
|
67019
67092
|
|
|
67020
|
-
|
|
67021
|
-
|
|
67022
|
-
|
|
67023
|
-
|
|
67024
|
-
|
|
67093
|
+
if (Array.isArray(options.app)) {
|
|
67094
|
+
return pTryEach(options.app, singleApp => open(target, {
|
|
67095
|
+
...options,
|
|
67096
|
+
app: singleApp
|
|
67097
|
+
}));
|
|
67098
|
+
}
|
|
67099
|
+
|
|
67100
|
+
let {name: app, arguments: appArguments = []} = options.app || {};
|
|
67101
|
+
appArguments = [...appArguments];
|
|
67025
67102
|
|
|
67026
67103
|
if (Array.isArray(app)) {
|
|
67027
|
-
|
|
67028
|
-
|
|
67104
|
+
return pTryEach(app, appName => open(target, {
|
|
67105
|
+
...options,
|
|
67106
|
+
app: {
|
|
67107
|
+
name: appName,
|
|
67108
|
+
arguments: appArguments
|
|
67109
|
+
}
|
|
67110
|
+
}));
|
|
67029
67111
|
}
|
|
67030
67112
|
|
|
67031
|
-
|
|
67113
|
+
let command;
|
|
67114
|
+
const cliArguments = [];
|
|
67115
|
+
const childProcessOptions = {};
|
|
67116
|
+
|
|
67117
|
+
if (platform === 'darwin') {
|
|
67032
67118
|
command = 'open';
|
|
67033
67119
|
|
|
67034
67120
|
if (options.wait) {
|
|
@@ -67039,10 +67125,14 @@ var open = async (target, options) => {
|
|
|
67039
67125
|
cliArguments.push('--background');
|
|
67040
67126
|
}
|
|
67041
67127
|
|
|
67128
|
+
if (options.newInstance) {
|
|
67129
|
+
cliArguments.push('--new');
|
|
67130
|
+
}
|
|
67131
|
+
|
|
67042
67132
|
if (app) {
|
|
67043
67133
|
cliArguments.push('-a', app);
|
|
67044
67134
|
}
|
|
67045
|
-
} else if (
|
|
67135
|
+
} else if (platform === 'win32' || (isWsl && !isDocker())) {
|
|
67046
67136
|
const mountPoint = await getWslDrivesMountPoint();
|
|
67047
67137
|
|
|
67048
67138
|
command = isWsl ?
|
|
@@ -67093,12 +67183,12 @@ var open = async (target, options) => {
|
|
|
67093
67183
|
// Check if local `xdg-open` exists and is executable.
|
|
67094
67184
|
let exeLocalXdgOpen = false;
|
|
67095
67185
|
try {
|
|
67096
|
-
await
|
|
67186
|
+
await fs$5.access(localXdgOpenPath, fsConstants.X_OK);
|
|
67097
67187
|
exeLocalXdgOpen = true;
|
|
67098
|
-
} catch
|
|
67188
|
+
} catch {}
|
|
67099
67189
|
|
|
67100
67190
|
const useSystemXdgOpen = process.versions.electron ||
|
|
67101
|
-
|
|
67191
|
+
platform === 'android' || isBundled || !exeLocalXdgOpen;
|
|
67102
67192
|
command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;
|
|
67103
67193
|
}
|
|
67104
67194
|
|
|
@@ -67116,7 +67206,7 @@ var open = async (target, options) => {
|
|
|
67116
67206
|
|
|
67117
67207
|
cliArguments.push(target);
|
|
67118
67208
|
|
|
67119
|
-
if (
|
|
67209
|
+
if (platform === 'darwin' && appArguments.length > 0) {
|
|
67120
67210
|
cliArguments.push('--args', ...appArguments);
|
|
67121
67211
|
}
|
|
67122
67212
|
|
|
@@ -67142,6 +67232,65 @@ var open = async (target, options) => {
|
|
|
67142
67232
|
return subprocess;
|
|
67143
67233
|
};
|
|
67144
67234
|
|
|
67235
|
+
function detectArchBinary(binary) {
|
|
67236
|
+
if (typeof binary === 'string' || Array.isArray(binary)) {
|
|
67237
|
+
return binary;
|
|
67238
|
+
}
|
|
67239
|
+
|
|
67240
|
+
const {[arch]: archBinary} = binary;
|
|
67241
|
+
|
|
67242
|
+
if (!archBinary) {
|
|
67243
|
+
throw new Error(`${arch} is not supported`);
|
|
67244
|
+
}
|
|
67245
|
+
|
|
67246
|
+
return archBinary;
|
|
67247
|
+
}
|
|
67248
|
+
|
|
67249
|
+
function detectPlatformBinary({[platform]: platformBinary}, {wsl}) {
|
|
67250
|
+
if (wsl && isWsl) {
|
|
67251
|
+
return detectArchBinary(wsl);
|
|
67252
|
+
}
|
|
67253
|
+
|
|
67254
|
+
if (!platformBinary) {
|
|
67255
|
+
throw new Error(`${platform} is not supported`);
|
|
67256
|
+
}
|
|
67257
|
+
|
|
67258
|
+
return detectArchBinary(platformBinary);
|
|
67259
|
+
}
|
|
67260
|
+
|
|
67261
|
+
const apps = {};
|
|
67262
|
+
|
|
67263
|
+
defineLazyProperty(apps, 'chrome', () => detectPlatformBinary({
|
|
67264
|
+
darwin: 'google chrome',
|
|
67265
|
+
win32: 'chrome',
|
|
67266
|
+
linux: ['google-chrome', 'google-chrome-stable']
|
|
67267
|
+
}, {
|
|
67268
|
+
wsl: {
|
|
67269
|
+
ia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',
|
|
67270
|
+
x64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe']
|
|
67271
|
+
}
|
|
67272
|
+
}));
|
|
67273
|
+
|
|
67274
|
+
defineLazyProperty(apps, 'firefox', () => detectPlatformBinary({
|
|
67275
|
+
darwin: 'firefox',
|
|
67276
|
+
win32: 'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
|
|
67277
|
+
linux: 'firefox'
|
|
67278
|
+
}, {
|
|
67279
|
+
wsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe'
|
|
67280
|
+
}));
|
|
67281
|
+
|
|
67282
|
+
defineLazyProperty(apps, 'edge', () => detectPlatformBinary({
|
|
67283
|
+
darwin: 'microsoft edge',
|
|
67284
|
+
win32: 'msedge',
|
|
67285
|
+
linux: 'microsoft-edge'
|
|
67286
|
+
}, {
|
|
67287
|
+
wsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'
|
|
67288
|
+
}));
|
|
67289
|
+
|
|
67290
|
+
open.apps = apps;
|
|
67291
|
+
|
|
67292
|
+
var open_1 = open;
|
|
67293
|
+
|
|
67145
67294
|
var execa$2 = {exports: {}};
|
|
67146
67295
|
|
|
67147
67296
|
var crossSpawn$1 = {exports: {}};
|
|
@@ -67719,7 +67868,7 @@ var enoent$1 = {
|
|
|
67719
67868
|
notFoundError,
|
|
67720
67869
|
};
|
|
67721
67870
|
|
|
67722
|
-
const cp = require$$
|
|
67871
|
+
const cp = require$$1__default$3;
|
|
67723
67872
|
const parse$2 = parse_1;
|
|
67724
67873
|
const enoent = enoent$1;
|
|
67725
67874
|
|
|
@@ -69163,7 +69312,7 @@ var command = {
|
|
|
69163
69312
|
};
|
|
69164
69313
|
|
|
69165
69314
|
const path$5 = path__default;
|
|
69166
|
-
const childProcess$2 = require$$
|
|
69315
|
+
const childProcess$2 = require$$1__default$3;
|
|
69167
69316
|
const crossSpawn = crossSpawn$1.exports;
|
|
69168
69317
|
const stripFinalNewline = stripFinalNewline$1;
|
|
69169
69318
|
const npmRunPath = npmRunPath$1.exports;
|
|
@@ -69483,8 +69632,8 @@ function startBrowserProcess(browser, url) {
|
|
|
69483
69632
|
try {
|
|
69484
69633
|
// Try our best to reuse existing tab
|
|
69485
69634
|
// on OS X Google Chrome with AppleScript
|
|
69486
|
-
require$$
|
|
69487
|
-
require$$
|
|
69635
|
+
require$$1$5.execSync('ps cax | grep "Google Chrome"');
|
|
69636
|
+
require$$1$5.execSync('osascript openChrome.applescript "' + encodeURI(url) + '"', {
|
|
69488
69637
|
cwd: path__default.dirname(require.resolve('vite/bin/openChrome.applescript')),
|
|
69489
69638
|
stdio: 'ignore'
|
|
69490
69639
|
});
|
|
@@ -69504,8 +69653,8 @@ function startBrowserProcess(browser, url) {
|
|
|
69504
69653
|
// Fallback to open
|
|
69505
69654
|
// (It will always open new tab)
|
|
69506
69655
|
try {
|
|
69507
|
-
const options = { app:
|
|
69508
|
-
|
|
69656
|
+
const options = browser ? { app: { name: browser } } : {};
|
|
69657
|
+
open_1(url, options).catch(() => { }); // Prevent `unhandledRejection` error.
|
|
69509
69658
|
return true;
|
|
69510
69659
|
}
|
|
69511
69660
|
catch (err) {
|
|
@@ -71660,7 +71809,7 @@ var windows = [
|
|
|
71660
71809
|
|
|
71661
71810
|
const path$4 = path__default;
|
|
71662
71811
|
const shellQuote = shellQuote$1;
|
|
71663
|
-
const childProcess$1 = require$$
|
|
71812
|
+
const childProcess$1 = require$$1__default$3;
|
|
71664
71813
|
|
|
71665
71814
|
// Map from full process name to binary that starts the process
|
|
71666
71815
|
// We can't just re-use full process name, because it will spawn a new instance
|
|
@@ -71809,7 +71958,7 @@ const fs$1 = fs__default;
|
|
|
71809
71958
|
const os$1 = require$$0__default$1;
|
|
71810
71959
|
const path$2 = path__default;
|
|
71811
71960
|
const chalk = chalk$1.exports;
|
|
71812
|
-
const childProcess = require$$
|
|
71961
|
+
const childProcess = require$$1__default$3;
|
|
71813
71962
|
|
|
71814
71963
|
const guessEditor = guess;
|
|
71815
71964
|
const getArgumentsForPosition = getArgs;
|
|
@@ -74707,4 +74856,4 @@ exports.sortUserPlugins = sortUserPlugins;
|
|
|
74707
74856
|
exports.source = source;
|
|
74708
74857
|
exports.sourceMap = sourceMap;
|
|
74709
74858
|
exports.vary = vary$1;
|
|
74710
|
-
//# sourceMappingURL=dep-
|
|
74859
|
+
//# sourceMappingURL=dep-cc49d7be.js.map
|