vite 3.0.0-alpha.8 → 3.0.0-alpha.9
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.
- package/dist/node/chunks/{dep-8259d5f4.js → dep-08f2a2be.js} +1 -1
- package/dist/node/chunks/{dep-6b269949.js → dep-3165073f.js} +1 -1
- package/dist/node/chunks/{dep-cfa39351.js → dep-523c8a1b.js} +1 -1
- package/dist/node/chunks/{dep-8250f392.js → dep-8df7bfd6.js} +26 -18
- package/dist/node/cli.js +5 -5
- package/dist/node/constants.js +1 -1
- package/dist/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as getAugmentedNamespace, y as getDefaultExportFromCjs } from './dep-
|
|
1
|
+
import { x as getAugmentedNamespace, y as getDefaultExportFromCjs } from './dep-8df7bfd6.js';
|
|
2
2
|
|
|
3
3
|
import { fileURLToPath as __cjs_fileURLToPath } from 'url';
|
|
4
4
|
import { dirname as __cjs_dirname } from 'path';
|
|
@@ -15045,7 +15045,17 @@ function tryNodeResolve(id, importer, options, targetWeb, depsOptimizer, ssr, ex
|
|
|
15045
15045
|
return resolved;
|
|
15046
15046
|
}
|
|
15047
15047
|
const resolvedExt = path$p.extname(resolved.id);
|
|
15048
|
-
|
|
15048
|
+
let resolvedId = id;
|
|
15049
|
+
if (isDeepImport) {
|
|
15050
|
+
// check ext before externalizing - only externalize
|
|
15051
|
+
// extension-less imports and explicit .js imports
|
|
15052
|
+
if (resolvedExt && !resolved.id.match(/(.js|.mjs|.cjs)$/)) {
|
|
15053
|
+
return;
|
|
15054
|
+
}
|
|
15055
|
+
if (!pkg?.data.exports && path$p.extname(id) !== resolvedExt) {
|
|
15056
|
+
resolvedId += resolvedExt;
|
|
15057
|
+
}
|
|
15058
|
+
}
|
|
15049
15059
|
return { ...resolved, id: resolvedId, external: true };
|
|
15050
15060
|
};
|
|
15051
15061
|
// link id to pkg for browser field mapping check
|
|
@@ -26000,7 +26010,7 @@ async function createPluginContainer({ plugins, logger, root, build: { rollupOpt
|
|
|
26000
26010
|
(await plugin.options.call(minimalContext, options)) || options;
|
|
26001
26011
|
}
|
|
26002
26012
|
if (options.acornInjectPlugins) {
|
|
26003
|
-
parser = Parser.extend(options.acornInjectPlugins);
|
|
26013
|
+
parser = Parser.extend(...arraify(options.acornInjectPlugins));
|
|
26004
26014
|
}
|
|
26005
26015
|
return {
|
|
26006
26016
|
acorn,
|
|
@@ -35904,7 +35914,7 @@ const assetAttrsConfig = {
|
|
|
35904
35914
|
const isAsyncScriptMap = new WeakMap();
|
|
35905
35915
|
async function traverseHtml(html, filePath, visitor) {
|
|
35906
35916
|
// lazy load compiler
|
|
35907
|
-
const { parse, transform } = await import('./dep-
|
|
35917
|
+
const { parse, transform } = await import('./dep-523c8a1b.js').then(function (n) { return n.c; });
|
|
35908
35918
|
// @vue/compiler-core doesn't like lowercase doctypes
|
|
35909
35919
|
html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
|
|
35910
35920
|
try {
|
|
@@ -37009,7 +37019,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
|
|
|
37009
37019
|
logger: config.logger
|
|
37010
37020
|
}));
|
|
37011
37021
|
if (isModule) {
|
|
37012
|
-
postcssPlugins.unshift((await import('./dep-
|
|
37022
|
+
postcssPlugins.unshift((await import('./dep-3165073f.js').then(function (n) { return n.i; })).default({
|
|
37013
37023
|
...modulesOptions,
|
|
37014
37024
|
getJSON(cssFileName, _modules, outputFileName) {
|
|
37015
37025
|
modules = _modules;
|
|
@@ -38099,21 +38109,12 @@ function createIsSsrExternal(config) {
|
|
|
38099
38109
|
isProduction: false,
|
|
38100
38110
|
isBuild: true
|
|
38101
38111
|
};
|
|
38102
|
-
const
|
|
38112
|
+
const isValidPackageEntry = (id) => {
|
|
38103
38113
|
if (!bareImportRE.test(id) || id.includes('\0')) {
|
|
38104
38114
|
return false;
|
|
38105
38115
|
}
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
}
|
|
38109
|
-
try {
|
|
38110
|
-
// no main entry, but deep imports may be allowed
|
|
38111
|
-
if (resolveFrom(`${id}/package.json`, root)) {
|
|
38112
|
-
return true;
|
|
38113
|
-
}
|
|
38114
|
-
}
|
|
38115
|
-
catch { }
|
|
38116
|
-
return false;
|
|
38116
|
+
return !!tryNodeResolve(id, undefined, resolveOptions, ssr?.target === 'webworker', undefined, true, true // try to externalize, will return undefined if not possible
|
|
38117
|
+
);
|
|
38117
38118
|
};
|
|
38118
38119
|
return (id) => {
|
|
38119
38120
|
if (processedIds.has(id)) {
|
|
@@ -38121,7 +38122,7 @@ function createIsSsrExternal(config) {
|
|
|
38121
38122
|
}
|
|
38122
38123
|
const external = !id.startsWith('.') &&
|
|
38123
38124
|
!path$p.isAbsolute(id) &&
|
|
38124
|
-
(isBuiltin(id) || (isConfiguredAsExternal(id) &&
|
|
38125
|
+
(isBuiltin(id) || (isConfiguredAsExternal(id) && isValidPackageEntry(id)));
|
|
38125
38126
|
processedIds.set(id, external);
|
|
38126
38127
|
return external;
|
|
38127
38128
|
};
|
|
@@ -41140,6 +41141,13 @@ async function doBuild(inlineConfig = {}) {
|
|
|
41140
41141
|
};
|
|
41141
41142
|
try {
|
|
41142
41143
|
const buildOutputOptions = (output = {}) => {
|
|
41144
|
+
// See https://github.com/vitejs/vite/issues/5812#issuecomment-984345618
|
|
41145
|
+
// @ts-ignore
|
|
41146
|
+
if (output.output) {
|
|
41147
|
+
config.logger.warn(`You've set "rollupOptions.output.output" in your config. ` +
|
|
41148
|
+
`This is deprecated and will override all Vite.js default output options. ` +
|
|
41149
|
+
`Please use "rollupOptions.output" instead.`);
|
|
41150
|
+
}
|
|
41143
41151
|
const cjsSsrBuild = ssr && config.ssr?.format === 'cjs';
|
|
41144
41152
|
const format = output.format || (cjsSsrBuild ? 'cjs' : 'es');
|
|
41145
41153
|
const jsExt = (ssr && config.ssr?.target !== 'webworker') || libOptions
|
|
@@ -47756,7 +47764,7 @@ async function getCertificate(cacheDir) {
|
|
|
47756
47764
|
return content;
|
|
47757
47765
|
}
|
|
47758
47766
|
catch {
|
|
47759
|
-
const content = (await import('./dep-
|
|
47767
|
+
const content = (await import('./dep-08f2a2be.js')).createCertificate();
|
|
47760
47768
|
promises
|
|
47761
47769
|
.mkdir(cacheDir, { recursive: true })
|
|
47762
47770
|
.then(() => promises.writeFile(cachePath, content))
|
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-
|
|
3
|
+
import { v as colors, j as createLogger, e as resolveConfig } from './chunks/dep-8df7bfd6.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-
|
|
685
|
+
const { createServer } = await import('./chunks/dep-8df7bfd6.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-
|
|
731
|
+
const { build } = await import('./chunks/dep-8df7bfd6.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-
|
|
755
|
+
const { optimizeDeps } = await import('./chunks/dep-8df7bfd6.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-
|
|
778
|
+
const { preview } = await import('./chunks/dep-8df7bfd6.js').then(function (n) { return n.C; });
|
|
779
779
|
try {
|
|
780
780
|
const server = await preview({
|
|
781
781
|
root,
|
package/dist/node/constants.js
CHANGED
package/dist/node/index.js
CHANGED
|
@@ -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-
|
|
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-8df7bfd6.js';
|
|
2
2
|
import 'fs';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'url';
|