vite 2.8.0-beta.1 → 2.8.0-beta.2
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 +20 -0
- package/dist/node/chunks/dep-0ebab0df.js +0 -1
- package/dist/node/chunks/dep-2056ae8a.js +0 -1
- package/dist/node/chunks/{dep-fccf00e1.js → dep-8072b56e.js} +146 -480
- package/dist/node/chunks/{dep-e4dc9ea2.js → dep-8a5fd784.js} +99 -65
- package/dist/node/chunks/{dep-51191982.js → dep-91aeb93b.js} +1 -2
- package/dist/node/chunks/{dep-e4a9e288.js → dep-a68f5a28.js} +1 -2
- package/dist/node/cli.js +4 -5
- package/dist/node/index.js +1 -2
- package/package.json +2 -2
- package/types/importMeta.d.ts +8 -2
- package/dist/node/build.d.ts +0 -200
- package/dist/node/certificate.d.ts +0 -2
- package/dist/node/chunks/dep-0ebab0df.js.map +0 -1
- package/dist/node/chunks/dep-2056ae8a.js.map +0 -1
- package/dist/node/chunks/dep-51191982.js.map +0 -1
- package/dist/node/chunks/dep-e4a9e288.js.map +0 -1
- package/dist/node/chunks/dep-e4dc9ea2.js.map +0 -1
- package/dist/node/chunks/dep-fccf00e1.js.map +0 -1
- package/dist/node/cli.d.ts +0 -1
- package/dist/node/cli.js.map +0 -1
- package/dist/node/config.d.ts +0 -227
- package/dist/node/constants.d.ts +0 -33
- package/dist/node/http.d.ts +0 -88
- package/dist/node/importGlob.d.ts +0 -14
- package/dist/node/index.js.map +0 -1
- package/dist/node/logger.d.ts +0 -35
- package/dist/node/optimizer/esbuildDepPlugin.d.ts +0 -4
- package/dist/node/optimizer/index.d.ts +0 -66
- package/dist/node/optimizer/registerMissing.d.ts +0 -2
- package/dist/node/optimizer/scan.d.ts +0 -9
- package/dist/node/packages.d.ts +0 -25
- package/dist/node/plugin.d.ts +0 -115
- package/dist/node/plugins/asset.d.ts +0 -40
- package/dist/node/plugins/assetImportMetaUrl.d.ts +0 -13
- package/dist/node/plugins/clientInjections.d.ts +0 -7
- package/dist/node/plugins/css.d.ts +0 -71
- package/dist/node/plugins/dataUri.d.ts +0 -5
- package/dist/node/plugins/define.d.ts +0 -3
- package/dist/node/plugins/esbuild.d.ts +0 -15
- package/dist/node/plugins/html.d.ts +0 -105
- package/dist/node/plugins/importAnalysis.d.ts +0 -46
- package/dist/node/plugins/importAnalysisBuild.d.ts +0 -15
- package/dist/node/plugins/index.d.ts +0 -3
- package/dist/node/plugins/json.d.ts +0 -22
- package/dist/node/plugins/loadFallback.d.ts +0 -5
- package/dist/node/plugins/manifest.d.ts +0 -14
- package/dist/node/plugins/modulePreloadPolyfill.d.ts +0 -4
- package/dist/node/plugins/preAlias.d.ts +0 -5
- package/dist/node/plugins/reporter.d.ts +0 -3
- package/dist/node/plugins/resolve.d.ts +0 -38
- package/dist/node/plugins/ssrRequireHook.d.ts +0 -12
- package/dist/node/plugins/terser.d.ts +0 -3
- package/dist/node/plugins/wasm.d.ts +0 -3
- package/dist/node/plugins/worker.d.ts +0 -5
- package/dist/node/plugins/workerImportMetaUrl.d.ts +0 -3
- package/dist/node/preview.d.ts +0 -31
- package/dist/node/server/hmr.d.ts +0 -37
- package/dist/node/server/index.d.ts +0 -222
- package/dist/node/server/middlewares/base.d.ts +0 -3
- package/dist/node/server/middlewares/error.d.ts +0 -8
- package/dist/node/server/middlewares/indexHtml.d.ts +0 -4
- package/dist/node/server/middlewares/proxy.d.ts +0 -20
- package/dist/node/server/middlewares/spaFallback.d.ts +0 -2
- package/dist/node/server/middlewares/static.d.ts +0 -6
- package/dist/node/server/middlewares/time.d.ts +0 -2
- package/dist/node/server/middlewares/transform.d.ts +0 -3
- package/dist/node/server/moduleGraph.d.ts +0 -53
- package/dist/node/server/openBrowser.d.ts +0 -15
- package/dist/node/server/pluginContainer.d.ts +0 -37
- package/dist/node/server/searchRoot.d.ts +0 -8
- package/dist/node/server/send.d.ts +0 -10
- package/dist/node/server/sourcemap.d.ts +0 -8
- package/dist/node/server/transformRequest.d.ts +0 -14
- package/dist/node/server/ws.d.ts +0 -14
- package/dist/node/ssr/ssrExternal.d.ts +0 -7
- package/dist/node/ssr/ssrManifestPlugin.d.ts +0 -3
- package/dist/node/ssr/ssrModuleLoader.d.ts +0 -7
- package/dist/node/ssr/ssrStacktrace.d.ts +0 -3
- package/dist/node/ssr/ssrTransform.d.ts +0 -8
- package/dist/node/utils.d.ts +0 -115
|
@@ -18916,7 +18916,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
18916
18916
|
replacer: urlReplacer
|
|
18917
18917
|
}));
|
|
18918
18918
|
if (isModule) {
|
|
18919
|
-
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-
|
|
18919
|
+
postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-a68f5a28.js'); }).then(function (n) { return n.index; })).default({
|
|
18920
18920
|
...modulesOptions,
|
|
18921
18921
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
18922
18922
|
modules = _modules;
|
|
@@ -19400,7 +19400,8 @@ async function transformImportGlob(source, pos, importer, importIndex, root, nor
|
|
|
19400
19400
|
}
|
|
19401
19401
|
const files = out.sync(pattern, {
|
|
19402
19402
|
cwd: base,
|
|
19403
|
-
|
|
19403
|
+
// Ignore node_modules by default unless explicitly indicated in the pattern
|
|
19404
|
+
ignore: /(^|\/)node_modules\//.test(pattern) ? [] : ['**/node_modules/**']
|
|
19404
19405
|
});
|
|
19405
19406
|
const imports = [];
|
|
19406
19407
|
let importsString = ``;
|
|
@@ -19939,7 +19940,7 @@ const assetAttrsConfig = {
|
|
|
19939
19940
|
const isAsyncScriptMap = new WeakMap();
|
|
19940
19941
|
async function traverseHtml(html, filePath, visitor) {
|
|
19941
19942
|
// lazy load compiler
|
|
19942
|
-
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-
|
|
19943
|
+
const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-91aeb93b.js'); }).then(function (n) { return n.compilerDom_cjs; });
|
|
19943
19944
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
19944
19945
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
19945
19946
|
try {
|
|
@@ -20007,11 +20008,30 @@ function buildHtmlPlugin(config) {
|
|
|
20007
20008
|
checkPublicFile(url, config);
|
|
20008
20009
|
// Same reason with `htmlInlineProxyPlugin`
|
|
20009
20010
|
isAsyncScriptMap.set(config, new Map());
|
|
20011
|
+
const inputFiles = new Set();
|
|
20010
20012
|
return {
|
|
20011
20013
|
name: 'vite:build-html',
|
|
20014
|
+
buildStart({ input }) {
|
|
20015
|
+
isAsyncScriptMap.set(config, new Map());
|
|
20016
|
+
let allInputs;
|
|
20017
|
+
if (typeof input === 'string') {
|
|
20018
|
+
allInputs = [input];
|
|
20019
|
+
}
|
|
20020
|
+
else if (Array.isArray(input)) {
|
|
20021
|
+
allInputs = input;
|
|
20022
|
+
}
|
|
20023
|
+
else {
|
|
20024
|
+
allInputs = Object.values(input);
|
|
20025
|
+
}
|
|
20026
|
+
for (const filename of allInputs) {
|
|
20027
|
+
if (filename.endsWith('.html')) {
|
|
20028
|
+
inputFiles.add(normalizePath$4(filename));
|
|
20029
|
+
}
|
|
20030
|
+
}
|
|
20031
|
+
},
|
|
20012
20032
|
async transform(html, id) {
|
|
20013
20033
|
var _a, _b;
|
|
20014
|
-
if (
|
|
20034
|
+
if (inputFiles.has(id)) {
|
|
20015
20035
|
const publicPath = `/${slash$1(path__default.relative(config.root, id))}`;
|
|
20016
20036
|
// pre-transform
|
|
20017
20037
|
html = await applyHtmlTransforms(html, preHooks, {
|
|
@@ -44442,7 +44462,7 @@ function readFileIfExists(value) {
|
|
|
44442
44462
|
return value;
|
|
44443
44463
|
}
|
|
44444
44464
|
async function createCertificateLazily() {
|
|
44445
|
-
const { createCertificate } = await Promise.resolve().then(function () { return require('./dep-
|
|
44465
|
+
const { createCertificate } = await Promise.resolve().then(function () { return require('./dep-8072b56e.js'); });
|
|
44446
44466
|
return createCertificate();
|
|
44447
44467
|
}
|
|
44448
44468
|
async function getCertificate(cacheDir) {
|
|
@@ -51667,6 +51687,37 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
|
|
|
51667
51687
|
function isInScope(name, parents) {
|
|
51668
51688
|
return parents.some((node) => { var _a; return node && ((_a = scopeMap.get(node)) === null || _a === void 0 ? void 0 : _a.has(name)); });
|
|
51669
51689
|
}
|
|
51690
|
+
function handlePattern(p, parentFunction) {
|
|
51691
|
+
if (p.type === 'Identifier') {
|
|
51692
|
+
setScope(parentFunction, p.name);
|
|
51693
|
+
}
|
|
51694
|
+
else if (p.type === 'RestElement') {
|
|
51695
|
+
handlePattern(p.argument, parentFunction);
|
|
51696
|
+
}
|
|
51697
|
+
else if (p.type === 'ObjectPattern') {
|
|
51698
|
+
p.properties.forEach((property) => {
|
|
51699
|
+
if (property.type === 'RestElement') {
|
|
51700
|
+
setScope(parentFunction, property.argument.name);
|
|
51701
|
+
}
|
|
51702
|
+
else {
|
|
51703
|
+
handlePattern(property.value, parentFunction);
|
|
51704
|
+
}
|
|
51705
|
+
});
|
|
51706
|
+
}
|
|
51707
|
+
else if (p.type === 'ArrayPattern') {
|
|
51708
|
+
p.elements.forEach((element) => {
|
|
51709
|
+
if (element) {
|
|
51710
|
+
handlePattern(element, parentFunction);
|
|
51711
|
+
}
|
|
51712
|
+
});
|
|
51713
|
+
}
|
|
51714
|
+
else if (p.type === 'AssignmentPattern') {
|
|
51715
|
+
handlePattern(p.left, parentFunction);
|
|
51716
|
+
}
|
|
51717
|
+
else {
|
|
51718
|
+
setScope(parentFunction, p.name);
|
|
51719
|
+
}
|
|
51720
|
+
}
|
|
51670
51721
|
walk$1(root, {
|
|
51671
51722
|
enter(node, parent) {
|
|
51672
51723
|
if (node.type === 'ImportDeclaration') {
|
|
@@ -51697,25 +51748,31 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
|
|
|
51697
51748
|
}
|
|
51698
51749
|
// walk function expressions and add its arguments to known identifiers
|
|
51699
51750
|
// so that we don't prefix them
|
|
51700
|
-
node.params.forEach((p) =>
|
|
51701
|
-
|
|
51702
|
-
|
|
51703
|
-
|
|
51704
|
-
// do not record as scope variable if is a destructuring keyword
|
|
51705
|
-
if (isStaticPropertyKey(child, parent))
|
|
51706
|
-
return;
|
|
51707
|
-
// do not record if this is a default value
|
|
51708
|
-
// assignment of a destructuring variable
|
|
51709
|
-
if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
|
|
51710
|
-
(parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
|
|
51711
|
-
((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
|
|
51712
|
-
(parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
|
|
51713
|
-
((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
|
|
51714
|
-
return;
|
|
51715
|
-
}
|
|
51716
|
-
setScope(node, child.name);
|
|
51751
|
+
node.params.forEach((p) => {
|
|
51752
|
+
if (p.type === 'ObjectPattern' || p.type === 'ArrayPattern') {
|
|
51753
|
+
handlePattern(p, node);
|
|
51754
|
+
return;
|
|
51717
51755
|
}
|
|
51718
|
-
|
|
51756
|
+
walk$1(p.type === 'AssignmentPattern' ? p.left : p, {
|
|
51757
|
+
enter(child, parent) {
|
|
51758
|
+
if (child.type !== 'Identifier')
|
|
51759
|
+
return;
|
|
51760
|
+
// do not record as scope variable if is a destructuring keyword
|
|
51761
|
+
if (isStaticPropertyKey(child, parent))
|
|
51762
|
+
return;
|
|
51763
|
+
// do not record if this is a default value
|
|
51764
|
+
// assignment of a destructuring variable
|
|
51765
|
+
if (((parent === null || parent === void 0 ? void 0 : parent.type) === 'AssignmentPattern' &&
|
|
51766
|
+
(parent === null || parent === void 0 ? void 0 : parent.right) === child) ||
|
|
51767
|
+
((parent === null || parent === void 0 ? void 0 : parent.type) === 'TemplateLiteral' &&
|
|
51768
|
+
(parent === null || parent === void 0 ? void 0 : parent.expressions.includes(child))) ||
|
|
51769
|
+
((parent === null || parent === void 0 ? void 0 : parent.type) === 'CallExpression' && (parent === null || parent === void 0 ? void 0 : parent.callee) === child)) {
|
|
51770
|
+
return;
|
|
51771
|
+
}
|
|
51772
|
+
setScope(node, child.name);
|
|
51773
|
+
}
|
|
51774
|
+
});
|
|
51775
|
+
});
|
|
51719
51776
|
}
|
|
51720
51777
|
else if (node.type === 'Property' && parent.type === 'ObjectPattern') {
|
|
51721
51778
|
node.inPattern = true;
|
|
@@ -51723,36 +51780,7 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
|
|
|
51723
51780
|
else if (node.type === 'VariableDeclarator') {
|
|
51724
51781
|
const parentFunction = findParentFunction(parentStack);
|
|
51725
51782
|
if (parentFunction) {
|
|
51726
|
-
|
|
51727
|
-
if (p.type === 'Identifier') {
|
|
51728
|
-
setScope(parentFunction, p.name);
|
|
51729
|
-
}
|
|
51730
|
-
else if (p.type === 'RestElement') {
|
|
51731
|
-
handlePattern(p.argument);
|
|
51732
|
-
}
|
|
51733
|
-
else if (p.type === 'ObjectPattern') {
|
|
51734
|
-
p.properties.forEach((property) => {
|
|
51735
|
-
if (property.type === 'RestElement') {
|
|
51736
|
-
setScope(parentFunction, property.argument.name);
|
|
51737
|
-
}
|
|
51738
|
-
else
|
|
51739
|
-
handlePattern(property.value);
|
|
51740
|
-
});
|
|
51741
|
-
}
|
|
51742
|
-
else if (p.type === 'ArrayPattern') {
|
|
51743
|
-
p.elements.forEach((element) => {
|
|
51744
|
-
if (element)
|
|
51745
|
-
handlePattern(element);
|
|
51746
|
-
});
|
|
51747
|
-
}
|
|
51748
|
-
else if (p.type === 'AssignmentPattern') {
|
|
51749
|
-
handlePattern(p.left);
|
|
51750
|
-
}
|
|
51751
|
-
else {
|
|
51752
|
-
setScope(parentFunction, p.name);
|
|
51753
|
-
}
|
|
51754
|
-
};
|
|
51755
|
-
handlePattern(node.id);
|
|
51783
|
+
handlePattern(node.id, parentFunction);
|
|
51756
51784
|
}
|
|
51757
51785
|
}
|
|
51758
51786
|
},
|
|
@@ -55752,7 +55780,7 @@ async function createServer(inlineConfig = {}) {
|
|
|
55752
55780
|
const config = await resolveConfig(inlineConfig, 'serve', 'development');
|
|
55753
55781
|
const root = config.root;
|
|
55754
55782
|
const serverConfig = config.server;
|
|
55755
|
-
const httpsOptions = await resolveHttpsConfig(config.server.https);
|
|
55783
|
+
const httpsOptions = await resolveHttpsConfig(config.server.https, config.cacheDir);
|
|
55756
55784
|
let { middlewareMode } = serverConfig;
|
|
55757
55785
|
if (middlewareMode === true) {
|
|
55758
55786
|
middlewareMode = 'ssr';
|
|
@@ -70467,14 +70495,6 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
|
70467
70495
|
continue;
|
|
70468
70496
|
}
|
|
70469
70497
|
const existing = merged[key];
|
|
70470
|
-
if (Array.isArray(existing) && Array.isArray(value)) {
|
|
70471
|
-
merged[key] = [...existing, ...value];
|
|
70472
|
-
continue;
|
|
70473
|
-
}
|
|
70474
|
-
if (isObject$3(existing) && isObject$3(value)) {
|
|
70475
|
-
merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
|
|
70476
|
-
continue;
|
|
70477
|
-
}
|
|
70478
70498
|
// fields that require special handling
|
|
70479
70499
|
if (existing != null) {
|
|
70480
70500
|
if (key === 'alias' && (rootPath === 'resolve' || rootPath === '')) {
|
|
@@ -70489,6 +70509,14 @@ function mergeConfigRecursively(defaults, overrides, rootPath) {
|
|
|
70489
70509
|
continue;
|
|
70490
70510
|
}
|
|
70491
70511
|
}
|
|
70512
|
+
if (Array.isArray(existing) || Array.isArray(value)) {
|
|
70513
|
+
merged[key] = [...arraify(existing), ...arraify(value)];
|
|
70514
|
+
continue;
|
|
70515
|
+
}
|
|
70516
|
+
if (isObject$3(existing) && isObject$3(value)) {
|
|
70517
|
+
merged[key] = mergeConfigRecursively(existing, value, rootPath ? `${rootPath}.${key}` : key);
|
|
70518
|
+
continue;
|
|
70519
|
+
}
|
|
70492
70520
|
merged[key] = value;
|
|
70493
70521
|
}
|
|
70494
70522
|
return merged;
|
|
@@ -70509,14 +70537,21 @@ function normalizeAlias(o) {
|
|
|
70509
70537
|
}
|
|
70510
70538
|
// https://github.com/vitejs/vite/issues/1363
|
|
70511
70539
|
// work around https://github.com/rollup/plugins/issues/759
|
|
70512
|
-
function normalizeSingleAlias({ find, replacement }) {
|
|
70540
|
+
function normalizeSingleAlias({ find, replacement, customResolver }) {
|
|
70513
70541
|
if (typeof find === 'string' &&
|
|
70514
70542
|
find.endsWith('/') &&
|
|
70515
70543
|
replacement.endsWith('/')) {
|
|
70516
70544
|
find = find.slice(0, find.length - 1);
|
|
70517
70545
|
replacement = replacement.slice(0, replacement.length - 1);
|
|
70518
70546
|
}
|
|
70519
|
-
|
|
70547
|
+
const alias = {
|
|
70548
|
+
find,
|
|
70549
|
+
replacement
|
|
70550
|
+
};
|
|
70551
|
+
if (customResolver) {
|
|
70552
|
+
alias.customResolver = customResolver;
|
|
70553
|
+
}
|
|
70554
|
+
return alias;
|
|
70520
70555
|
}
|
|
70521
70556
|
function sortUserPlugins(plugins) {
|
|
70522
70557
|
const prePlugins = [];
|
|
@@ -70787,4 +70822,3 @@ exports.searchForWorkspaceRoot = searchForWorkspaceRoot;
|
|
|
70787
70822
|
exports.send = send$1;
|
|
70788
70823
|
exports.sortUserPlugins = sortUserPlugins;
|
|
70789
70824
|
exports.transformWithEsbuild = transformWithEsbuild;
|
|
70790
|
-
//# sourceMappingURL=dep-e4dc9ea2.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var build = require('./dep-
|
|
3
|
+
var build = require('./dep-8a5fd784.js');
|
|
4
4
|
|
|
5
5
|
function _mergeNamespaces(n, m) {
|
|
6
6
|
for (var i = 0; i < m.length; i++) {
|
|
@@ -8738,4 +8738,3 @@ var compilerDom_cjs$1 = /*#__PURE__*/_mergeNamespaces({
|
|
|
8738
8738
|
}, [compilerDom_cjs$2]);
|
|
8739
8739
|
|
|
8740
8740
|
exports.compilerDom_cjs = compilerDom_cjs$1;
|
|
8741
|
-
//# sourceMappingURL=dep-51191982.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var require$$0 = require('postcss');
|
|
4
|
-
var build$2 = require('./dep-
|
|
4
|
+
var build$2 = require('./dep-8a5fd784.js');
|
|
5
5
|
var path$2 = require('path');
|
|
6
6
|
var require$$1 = require('crypto');
|
|
7
7
|
var fs = require('fs');
|
|
@@ -7505,4 +7505,3 @@ var index = /*#__PURE__*/_mergeNamespaces({
|
|
|
7505
7505
|
}, [build$1.exports]);
|
|
7506
7506
|
|
|
7507
7507
|
exports.index = index;
|
|
7508
|
-
//# sourceMappingURL=dep-e4a9e288.js.map
|
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 build = require('./chunks/dep-
|
|
4
|
+
var build = require('./chunks/dep-8a5fd784.js');
|
|
5
5
|
var perf_hooks = require('perf_hooks');
|
|
6
6
|
require('fs');
|
|
7
7
|
require('path');
|
|
@@ -684,7 +684,7 @@ cli
|
|
|
684
684
|
.action(async (root, options) => {
|
|
685
685
|
// output structure is preserved even after bundling so require()
|
|
686
686
|
// is ok here
|
|
687
|
-
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
687
|
+
const { createServer } = await Promise.resolve().then(function () { return require('./chunks/dep-8a5fd784.js'); }).then(function (n) { return n.index$1; });
|
|
688
688
|
try {
|
|
689
689
|
const server = await createServer({
|
|
690
690
|
root,
|
|
@@ -733,7 +733,7 @@ cli
|
|
|
733
733
|
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
|
734
734
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
|
735
735
|
.action(async (root, options) => {
|
|
736
|
-
const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
736
|
+
const { build: build$1 } = await Promise.resolve().then(function () { return require('./chunks/dep-8a5fd784.js'); }).then(function (n) { return n.build$1; });
|
|
737
737
|
const buildOptions = cleanOptions(options);
|
|
738
738
|
try {
|
|
739
739
|
await build$1({
|
|
@@ -756,7 +756,7 @@ cli
|
|
|
756
756
|
.command('optimize [root]')
|
|
757
757
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
|
758
758
|
.action(async (root, options) => {
|
|
759
|
-
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-
|
|
759
|
+
const { optimizeDeps } = await Promise.resolve().then(function () { return require('./chunks/dep-8a5fd784.js'); }).then(function (n) { return n.index; });
|
|
760
760
|
try {
|
|
761
761
|
const config = await build.resolveConfig({
|
|
762
762
|
root,
|
|
@@ -804,4 +804,3 @@ cli
|
|
|
804
804
|
cli.help();
|
|
805
805
|
cli.version(require('../../package.json').version);
|
|
806
806
|
cli.parse();
|
|
807
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var build = require('./chunks/dep-
|
|
5
|
+
var build = require('./chunks/dep-8a5fd784.js');
|
|
6
6
|
require('fs');
|
|
7
7
|
require('path');
|
|
8
8
|
require('tty');
|
|
@@ -50,4 +50,3 @@ exports.searchForWorkspaceRoot = build.searchForWorkspaceRoot;
|
|
|
50
50
|
exports.send = build.send;
|
|
51
51
|
exports.sortUserPlugins = build.sortUserPlugins;
|
|
52
52
|
exports.transformWithEsbuild = build.transformWithEsbuild;
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite",
|
|
3
|
-
"version": "2.8.0-beta.
|
|
3
|
+
"version": "2.8.0-beta.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"description": "Native-ESM powered web dev build tool",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"magic-string": "^0.25.7",
|
|
100
100
|
"micromatch": "^4.0.4",
|
|
101
101
|
"mrmime": "^1.0.0",
|
|
102
|
-
"node-forge": "^
|
|
102
|
+
"node-forge": "^1.2.0",
|
|
103
103
|
"okie": "^1.0.1",
|
|
104
104
|
"open": "^8.4.0",
|
|
105
105
|
"periscopic": "^2.0.3",
|
package/types/importMeta.d.ts
CHANGED
|
@@ -50,14 +50,20 @@ interface ImportMeta {
|
|
|
50
50
|
|
|
51
51
|
readonly env: ImportMetaEnv
|
|
52
52
|
|
|
53
|
-
glob(
|
|
53
|
+
glob(
|
|
54
|
+
pattern: string,
|
|
55
|
+
options?: import('../src/node/importGlob').AssertOptions
|
|
56
|
+
): Record<
|
|
54
57
|
string,
|
|
55
58
|
() => Promise<{
|
|
56
59
|
[key: string]: any
|
|
57
60
|
}>
|
|
58
61
|
>
|
|
59
62
|
|
|
60
|
-
globEager(
|
|
63
|
+
globEager(
|
|
64
|
+
pattern: string,
|
|
65
|
+
options?: import('../src/node/importGlob').AssertOptions
|
|
66
|
+
): Record<
|
|
61
67
|
string,
|
|
62
68
|
{
|
|
63
69
|
[key: string]: any
|
package/dist/node/build.d.ts
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import type { InlineConfig, ResolvedConfig } from './config';
|
|
2
|
-
import type { Plugin, RollupOptions, RollupWarning, WarningHandler, RollupOutput, WatcherOptions, RollupWatcher, ModuleFormat } from 'rollup';
|
|
3
|
-
import type { Terser } from 'types/terser';
|
|
4
|
-
import type { RollupCommonJSOptions } from 'types/commonjs';
|
|
5
|
-
import type { RollupDynamicImportVarsOptions } from 'types/dynamicImportVars';
|
|
6
|
-
import type { TransformOptions } from 'esbuild';
|
|
7
|
-
export interface BuildOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Base public path when served in production.
|
|
10
|
-
* @deprecated `base` is now a root-level config option.
|
|
11
|
-
*/
|
|
12
|
-
base?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Compatibility transform target. The transform is performed with esbuild
|
|
15
|
-
* and the lowest supported target is es2015/es6. Note this only handles
|
|
16
|
-
* syntax transformation and does not cover polyfills (except for dynamic
|
|
17
|
-
* import)
|
|
18
|
-
*
|
|
19
|
-
* Default: 'modules' - Similar to `@babel/preset-env`'s targets.esmodules,
|
|
20
|
-
* transpile targeting browsers that natively support dynamic es module imports.
|
|
21
|
-
* https://caniuse.com/es6-module-dynamic-import
|
|
22
|
-
*
|
|
23
|
-
* Another special value is 'esnext' - which only performs minimal transpiling
|
|
24
|
-
* (for minification compat) and assumes native dynamic imports support.
|
|
25
|
-
*
|
|
26
|
-
* For custom targets, see https://esbuild.github.io/api/#target and
|
|
27
|
-
* https://esbuild.github.io/content-types/#javascript for more details.
|
|
28
|
-
*/
|
|
29
|
-
target?: 'modules' | TransformOptions['target'] | false;
|
|
30
|
-
/**
|
|
31
|
-
* whether to inject module preload polyfill.
|
|
32
|
-
* Note: does not apply to library mode.
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
polyfillModulePreload?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* whether to inject dynamic import polyfill.
|
|
38
|
-
* Note: does not apply to library mode.
|
|
39
|
-
* @default false
|
|
40
|
-
* @deprecated use plugin-legacy for browsers that don't support dynamic import
|
|
41
|
-
*/
|
|
42
|
-
polyfillDynamicImport?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Directory relative from `root` where build output will be placed. If the
|
|
45
|
-
* directory exists, it will be removed before the build.
|
|
46
|
-
* @default 'dist'
|
|
47
|
-
*/
|
|
48
|
-
outDir?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Directory relative from `outDir` where the built js/css/image assets will
|
|
51
|
-
* be placed.
|
|
52
|
-
* @default 'assets'
|
|
53
|
-
*/
|
|
54
|
-
assetsDir?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Static asset files smaller than this number (in bytes) will be inlined as
|
|
57
|
-
* base64 strings. Default limit is `4096` (4kb). Set to `0` to disable.
|
|
58
|
-
* @default 4096
|
|
59
|
-
*/
|
|
60
|
-
assetsInlineLimit?: number;
|
|
61
|
-
/**
|
|
62
|
-
* Whether to code-split CSS. When enabled, CSS in async chunks will be
|
|
63
|
-
* inlined as strings in the chunk and inserted via dynamically created
|
|
64
|
-
* style tags when the chunk is loaded.
|
|
65
|
-
* @default true
|
|
66
|
-
*/
|
|
67
|
-
cssCodeSplit?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* An optional separate target for CSS minification.
|
|
70
|
-
* As esbuild only supports configuring targets to mainstream
|
|
71
|
-
* browsers, users may need this option when they are targeting
|
|
72
|
-
* a niche browser that comes with most modern JavaScript features
|
|
73
|
-
* but has poor CSS support, e.g. Android WeChat WebView, which
|
|
74
|
-
* doesn't support the #RGBA syntax.
|
|
75
|
-
*/
|
|
76
|
-
cssTarget?: TransformOptions['target'] | false;
|
|
77
|
-
/**
|
|
78
|
-
* If `true`, a separate sourcemap file will be created. If 'inline', the
|
|
79
|
-
* sourcemap will be appended to the resulting output file as data URI.
|
|
80
|
-
* 'hidden' works like `true` except that the corresponding sourcemap
|
|
81
|
-
* comments in the bundled files are suppressed.
|
|
82
|
-
* @default false
|
|
83
|
-
*/
|
|
84
|
-
sourcemap?: boolean | 'inline' | 'hidden';
|
|
85
|
-
/**
|
|
86
|
-
* Set to `false` to disable minification, or specify the minifier to use.
|
|
87
|
-
* Available options are 'terser' or 'esbuild'.
|
|
88
|
-
* @default 'esbuild'
|
|
89
|
-
*/
|
|
90
|
-
minify?: boolean | 'terser' | 'esbuild';
|
|
91
|
-
/**
|
|
92
|
-
* Options for terser
|
|
93
|
-
* https://terser.org/docs/api-reference#minify-options
|
|
94
|
-
*/
|
|
95
|
-
terserOptions?: Terser.MinifyOptions;
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated Vite now uses esbuild for CSS minification.
|
|
98
|
-
*/
|
|
99
|
-
cleanCssOptions?: any;
|
|
100
|
-
/**
|
|
101
|
-
* Will be merged with internal rollup options.
|
|
102
|
-
* https://rollupjs.org/guide/en/#big-list-of-options
|
|
103
|
-
*/
|
|
104
|
-
rollupOptions?: RollupOptions;
|
|
105
|
-
/**
|
|
106
|
-
* Options to pass on to `@rollup/plugin-commonjs`
|
|
107
|
-
*/
|
|
108
|
-
commonjsOptions?: RollupCommonJSOptions;
|
|
109
|
-
/**
|
|
110
|
-
* Options to pass on to `@rollup/plugin-dynamic-import-vars`
|
|
111
|
-
*/
|
|
112
|
-
dynamicImportVarsOptions?: RollupDynamicImportVarsOptions;
|
|
113
|
-
/**
|
|
114
|
-
* Whether to write bundle to disk
|
|
115
|
-
* @default true
|
|
116
|
-
*/
|
|
117
|
-
write?: boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Empty outDir on write.
|
|
120
|
-
* @default true when outDir is a sub directory of project root
|
|
121
|
-
*/
|
|
122
|
-
emptyOutDir?: boolean | null;
|
|
123
|
-
/**
|
|
124
|
-
* Whether to emit a manifest.json under assets dir to map hash-less filenames
|
|
125
|
-
* to their hashed versions. Useful when you want to generate your own HTML
|
|
126
|
-
* instead of using the one generated by Vite.
|
|
127
|
-
*
|
|
128
|
-
* Example:
|
|
129
|
-
*
|
|
130
|
-
* ```json
|
|
131
|
-
* {
|
|
132
|
-
* "main.js": {
|
|
133
|
-
* "file": "main.68fe3fad.js",
|
|
134
|
-
* "css": "main.e6b63442.css",
|
|
135
|
-
* "imports": [...],
|
|
136
|
-
* "dynamicImports": [...]
|
|
137
|
-
* }
|
|
138
|
-
* }
|
|
139
|
-
* ```
|
|
140
|
-
* @default false
|
|
141
|
-
*/
|
|
142
|
-
manifest?: boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Build in library mode. The value should be the global name of the lib in
|
|
145
|
-
* UMD mode. This will produce esm + cjs + umd bundle formats with default
|
|
146
|
-
* configurations that are suitable for distributing libraries.
|
|
147
|
-
*/
|
|
148
|
-
lib?: LibraryOptions | false;
|
|
149
|
-
/**
|
|
150
|
-
* Produce SSR oriented build. Note this requires specifying SSR entry via
|
|
151
|
-
* `rollupOptions.input`.
|
|
152
|
-
*/
|
|
153
|
-
ssr?: boolean | string;
|
|
154
|
-
/**
|
|
155
|
-
* Generate SSR manifest for determining style links and asset preload
|
|
156
|
-
* directives in production.
|
|
157
|
-
*/
|
|
158
|
-
ssrManifest?: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Set to false to disable reporting compressed chunk sizes.
|
|
161
|
-
* Can slightly improve build speed.
|
|
162
|
-
*/
|
|
163
|
-
reportCompressedSize?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Set to false to disable brotli compressed size reporting for build.
|
|
166
|
-
* Can slightly improve build speed.
|
|
167
|
-
* @deprecated use `build.reportCompressedSize` instead.
|
|
168
|
-
*/
|
|
169
|
-
brotliSize?: boolean;
|
|
170
|
-
/**
|
|
171
|
-
* Adjust chunk size warning limit (in kbs).
|
|
172
|
-
* @default 500
|
|
173
|
-
*/
|
|
174
|
-
chunkSizeWarningLimit?: number;
|
|
175
|
-
/**
|
|
176
|
-
* Rollup watch options
|
|
177
|
-
* https://rollupjs.org/guide/en/#watchoptions
|
|
178
|
-
*/
|
|
179
|
-
watch?: WatcherOptions | null;
|
|
180
|
-
}
|
|
181
|
-
export interface LibraryOptions {
|
|
182
|
-
entry: string;
|
|
183
|
-
name?: string;
|
|
184
|
-
formats?: LibraryFormats[];
|
|
185
|
-
fileName?: string | ((format: ModuleFormat) => string);
|
|
186
|
-
}
|
|
187
|
-
export declare type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife';
|
|
188
|
-
export declare type ResolvedBuildOptions = Required<Omit<BuildOptions, 'base' | 'cleanCssOptions' | 'polyfillDynamicImport' | 'brotliSize'>>;
|
|
189
|
-
export declare function resolveBuildOptions(root: string, raw?: BuildOptions, isBuild?: boolean): ResolvedBuildOptions;
|
|
190
|
-
export declare function resolveBuildPlugins(config: ResolvedConfig): {
|
|
191
|
-
pre: Plugin[];
|
|
192
|
-
post: Plugin[];
|
|
193
|
-
};
|
|
194
|
-
/**
|
|
195
|
-
* Bundles the app for production.
|
|
196
|
-
* Returns a Promise containing the build result.
|
|
197
|
-
*/
|
|
198
|
-
export declare function build(inlineConfig?: InlineConfig): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
|
|
199
|
-
export declare function resolveLibFilename(libOptions: LibraryOptions, format: ModuleFormat, root: string): string;
|
|
200
|
-
export declare function onRollupWarning(warning: RollupWarning, warn: WarningHandler, config: ResolvedConfig): void;
|