vite 6.0.0-alpha.3 → 6.0.0-alpha.4
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-DitPlFWl.js → dep-8UjKy9Ch.js} +157 -137
- package/dist/node/cli.js +16 -20
- package/dist/node/index.d.ts +20 -11
- package/dist/node/index.js +2 -2
- package/package.json +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
import fs$l, { promises as promises$1, existsSync as existsSync$1, readFileSync as readFileSync$1 } from 'node:fs';
|
2
2
|
import fsp from 'node:fs/promises';
|
3
|
-
import path$o, {
|
3
|
+
import path$o, { posix as posix$1, isAbsolute as isAbsolute$2, join as join$2, dirname as dirname$2, extname as extname$1, relative as relative$2, basename as basename$2 } from 'node:path';
|
4
4
|
import { fileURLToPath, URL as URL$3, parse as parse$i, pathToFileURL } from 'node:url';
|
5
5
|
import { promisify as promisify$4, format as format$2, inspect } from 'node:util';
|
6
6
|
import { performance } from 'node:perf_hooks';
|
@@ -29195,68 +29195,6 @@ const environmentColors = [
|
|
29195
29195
|
colors$1.gray,
|
29196
29196
|
];
|
29197
29197
|
|
29198
|
-
// https://github.com/vitejs/vite/issues/2820#issuecomment-812495079
|
29199
|
-
const ROOT_FILES = [
|
29200
|
-
// '.git',
|
29201
|
-
// https://pnpm.io/workspaces/
|
29202
|
-
'pnpm-workspace.yaml',
|
29203
|
-
// https://rushjs.io/pages/advanced/config_files/
|
29204
|
-
// 'rush.json',
|
29205
|
-
// https://nx.dev/latest/react/getting-started/nx-setup
|
29206
|
-
// 'workspace.json',
|
29207
|
-
// 'nx.json',
|
29208
|
-
// https://github.com/lerna/lerna#lernajson
|
29209
|
-
'lerna.json',
|
29210
|
-
];
|
29211
|
-
// npm: https://docs.npmjs.com/cli/v7/using-npm/workspaces#installing-workspaces
|
29212
|
-
// yarn: https://classic.yarnpkg.com/en/docs/workspaces/#toc-how-to-use-it
|
29213
|
-
function hasWorkspacePackageJSON(root) {
|
29214
|
-
const path = join$2(root, 'package.json');
|
29215
|
-
if (!isFileReadable(path)) {
|
29216
|
-
return false;
|
29217
|
-
}
|
29218
|
-
try {
|
29219
|
-
const content = JSON.parse(fs$l.readFileSync(path, 'utf-8')) || {};
|
29220
|
-
return !!content.workspaces;
|
29221
|
-
}
|
29222
|
-
catch {
|
29223
|
-
return false;
|
29224
|
-
}
|
29225
|
-
}
|
29226
|
-
function hasRootFile(root) {
|
29227
|
-
return ROOT_FILES.some((file) => fs$l.existsSync(join$2(root, file)));
|
29228
|
-
}
|
29229
|
-
function hasPackageJSON(root) {
|
29230
|
-
const path = join$2(root, 'package.json');
|
29231
|
-
return fs$l.existsSync(path);
|
29232
|
-
}
|
29233
|
-
/**
|
29234
|
-
* Search up for the nearest `package.json`
|
29235
|
-
*/
|
29236
|
-
function searchForPackageRoot(current, root = current) {
|
29237
|
-
if (hasPackageJSON(current))
|
29238
|
-
return current;
|
29239
|
-
const dir = dirname$2(current);
|
29240
|
-
// reach the fs root
|
29241
|
-
if (!dir || dir === current)
|
29242
|
-
return root;
|
29243
|
-
return searchForPackageRoot(dir, root);
|
29244
|
-
}
|
29245
|
-
/**
|
29246
|
-
* Search up for the nearest workspace root
|
29247
|
-
*/
|
29248
|
-
function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
29249
|
-
if (hasRootFile(current))
|
29250
|
-
return current;
|
29251
|
-
if (hasWorkspacePackageJSON(current))
|
29252
|
-
return current;
|
29253
|
-
const dir = dirname$2(current);
|
29254
|
-
// reach the fs root
|
29255
|
-
if (!dir || dir === current)
|
29256
|
-
return root;
|
29257
|
-
return searchForWorkspaceRoot(dir, root);
|
29258
|
-
}
|
29259
|
-
|
29260
29198
|
// An implementation of fsUtils without caching
|
29261
29199
|
const commonFsUtils = {
|
29262
29200
|
existsSync: fs$l.existsSync,
|
@@ -29332,7 +29270,7 @@ function pathUntilPart(root, parts, i) {
|
|
29332
29270
|
return p;
|
29333
29271
|
}
|
29334
29272
|
function createCachedFsUtils(config) {
|
29335
|
-
const root =
|
29273
|
+
const root = config.root; // root is resolved and normalized, so it doesn't have a trailing slash
|
29336
29274
|
const rootDirPath = `${root}/`;
|
29337
29275
|
const rootCache = { type: 'directory' }; // dirents will be computed lazily
|
29338
29276
|
const getDirentCacheSync = (parts) => {
|
@@ -47518,15 +47456,12 @@ class ServerHMRBroadcasterClient {
|
|
47518
47456
|
* @experimental
|
47519
47457
|
*/
|
47520
47458
|
class ServerHMRConnector {
|
47521
|
-
handlers = [];
|
47522
47459
|
hmrChannel;
|
47460
|
+
handlers = [];
|
47523
47461
|
hmrClient;
|
47524
47462
|
connected = false;
|
47525
|
-
constructor(
|
47526
|
-
|
47527
|
-
if (!hmrChannel) {
|
47528
|
-
throw new Error("Your version of Vite doesn't support HMR during SSR. Please, use Vite 5.1 or higher.");
|
47529
|
-
}
|
47463
|
+
constructor(hmrChannel) {
|
47464
|
+
this.hmrChannel = hmrChannel;
|
47530
47465
|
this.hmrClient = new ServerHMRBroadcasterClient(hmrChannel);
|
47531
47466
|
hmrChannel.api.outsideEmitter.on('send', (payload) => {
|
47532
47467
|
this.handlers.forEach((listener) => listener(payload));
|
@@ -47547,8 +47482,8 @@ class ServerHMRConnector {
|
|
47547
47482
|
}
|
47548
47483
|
}
|
47549
47484
|
|
47550
|
-
function createHMROptions(
|
47551
|
-
if (
|
47485
|
+
function createHMROptions(environment, options) {
|
47486
|
+
if (environment.config.server.hmr === false || options.hmr === false) {
|
47552
47487
|
return false;
|
47553
47488
|
}
|
47554
47489
|
if (options.hmr?.connection) {
|
@@ -47557,7 +47492,9 @@ function createHMROptions(server, options) {
|
|
47557
47492
|
logger: options.hmr.logger,
|
47558
47493
|
};
|
47559
47494
|
}
|
47560
|
-
|
47495
|
+
if (!('api' in environment.hot))
|
47496
|
+
return false;
|
47497
|
+
const connection = new ServerHMRConnector(environment.hot);
|
47561
47498
|
return {
|
47562
47499
|
connection,
|
47563
47500
|
logger: options.hmr?.logger,
|
@@ -47589,8 +47526,8 @@ function resolveSourceMapOptions(options) {
|
|
47589
47526
|
* Create an instance of the Vite SSR runtime that support HMR.
|
47590
47527
|
* @experimental
|
47591
47528
|
*/
|
47592
|
-
function createServerModuleRunner(
|
47593
|
-
const hmr = createHMROptions(
|
47529
|
+
function createServerModuleRunner(environment, options = {}) {
|
47530
|
+
const hmr = createHMROptions(environment, options);
|
47594
47531
|
return new ModuleRunner({
|
47595
47532
|
...options,
|
47596
47533
|
root: environment.config.root,
|
@@ -47603,12 +47540,10 @@ function createServerModuleRunner(server, environment, options = {}) {
|
|
47603
47540
|
}
|
47604
47541
|
|
47605
47542
|
async function ssrLoadModule(url, server, _context = { global }, _urlStack = [], fixStacktrace) {
|
47606
|
-
server.config.logger.warnOnce(colors$1.yellow('`ssrLoadModule` is deprecated and will be removed in the next major version. ' +
|
47607
|
-
'Use `createServerModuleRunner(environment).import(url)` from "vite/module-runner" ' +
|
47608
|
-
'to load modules instead.'));
|
47609
47543
|
const runner = server._ssrCompatModuleRunner ||
|
47610
|
-
(server._ssrCompatModuleRunner = createServerModuleRunner(server
|
47544
|
+
(server._ssrCompatModuleRunner = createServerModuleRunner(server.environments.ssr, {
|
47611
47545
|
sourcemapInterceptor: false,
|
47546
|
+
hmr: false,
|
47612
47547
|
}));
|
47613
47548
|
url = unwrapId$1(url);
|
47614
47549
|
return instantiateModule(url, runner, server, fixStacktrace);
|
@@ -59910,6 +59845,68 @@ function notFoundMiddleware() {
|
|
59910
59845
|
};
|
59911
59846
|
}
|
59912
59847
|
|
59848
|
+
// https://github.com/vitejs/vite/issues/2820#issuecomment-812495079
|
59849
|
+
const ROOT_FILES = [
|
59850
|
+
// '.git',
|
59851
|
+
// https://pnpm.io/workspaces/
|
59852
|
+
'pnpm-workspace.yaml',
|
59853
|
+
// https://rushjs.io/pages/advanced/config_files/
|
59854
|
+
// 'rush.json',
|
59855
|
+
// https://nx.dev/latest/react/getting-started/nx-setup
|
59856
|
+
// 'workspace.json',
|
59857
|
+
// 'nx.json',
|
59858
|
+
// https://github.com/lerna/lerna#lernajson
|
59859
|
+
'lerna.json',
|
59860
|
+
];
|
59861
|
+
// npm: https://docs.npmjs.com/cli/v7/using-npm/workspaces#installing-workspaces
|
59862
|
+
// yarn: https://classic.yarnpkg.com/en/docs/workspaces/#toc-how-to-use-it
|
59863
|
+
function hasWorkspacePackageJSON(root) {
|
59864
|
+
const path = join$2(root, 'package.json');
|
59865
|
+
if (!isFileReadable(path)) {
|
59866
|
+
return false;
|
59867
|
+
}
|
59868
|
+
try {
|
59869
|
+
const content = JSON.parse(fs$l.readFileSync(path, 'utf-8')) || {};
|
59870
|
+
return !!content.workspaces;
|
59871
|
+
}
|
59872
|
+
catch {
|
59873
|
+
return false;
|
59874
|
+
}
|
59875
|
+
}
|
59876
|
+
function hasRootFile(root) {
|
59877
|
+
return ROOT_FILES.some((file) => fs$l.existsSync(join$2(root, file)));
|
59878
|
+
}
|
59879
|
+
function hasPackageJSON(root) {
|
59880
|
+
const path = join$2(root, 'package.json');
|
59881
|
+
return fs$l.existsSync(path);
|
59882
|
+
}
|
59883
|
+
/**
|
59884
|
+
* Search up for the nearest `package.json`
|
59885
|
+
*/
|
59886
|
+
function searchForPackageRoot(current, root = current) {
|
59887
|
+
if (hasPackageJSON(current))
|
59888
|
+
return current;
|
59889
|
+
const dir = dirname$2(current);
|
59890
|
+
// reach the fs root
|
59891
|
+
if (!dir || dir === current)
|
59892
|
+
return root;
|
59893
|
+
return searchForPackageRoot(dir, root);
|
59894
|
+
}
|
59895
|
+
/**
|
59896
|
+
* Search up for the nearest workspace root
|
59897
|
+
*/
|
59898
|
+
function searchForWorkspaceRoot(current, root = searchForPackageRoot(current)) {
|
59899
|
+
if (hasRootFile(current))
|
59900
|
+
return current;
|
59901
|
+
if (hasWorkspacePackageJSON(current))
|
59902
|
+
return current;
|
59903
|
+
const dir = dirname$2(current);
|
59904
|
+
// reach the fs root
|
59905
|
+
if (!dir || dir === current)
|
59906
|
+
return root;
|
59907
|
+
return searchForWorkspaceRoot(dir, root);
|
59908
|
+
}
|
59909
|
+
|
59913
59910
|
function warmupFiles(server) {
|
59914
59911
|
const { root } = server.config;
|
59915
59912
|
for (const environment of Object.values(server.environments)) {
|
@@ -61245,6 +61242,8 @@ async function _createServer(inlineConfig = {}, options) {
|
|
61245
61242
|
if (typeof config.server.hmr === 'object' && config.server.hmr.channels) {
|
61246
61243
|
config.server.hmr.channels.forEach((channel) => hot.addChannel(channel));
|
61247
61244
|
}
|
61245
|
+
const publicFiles = await initPublicFilesPromise;
|
61246
|
+
const { publicDir } = config;
|
61248
61247
|
if (httpServer) {
|
61249
61248
|
setClientErrorHandler(httpServer, config.logger);
|
61250
61249
|
}
|
@@ -61257,6 +61256,9 @@ async function _createServer(inlineConfig = {}, options) {
|
|
61257
61256
|
root,
|
61258
61257
|
...config.configFileDependencies,
|
61259
61258
|
...getEnvFilesForMode(config.mode, config.envDir),
|
61259
|
+
// Watch the public directory explicitly because it might be outside
|
61260
|
+
// of the root directory.
|
61261
|
+
...(publicDir && publicFiles ? [publicDir] : []),
|
61260
61262
|
], resolvedWatchOptions)
|
61261
61263
|
: createNoopWatcher(resolvedWatchOptions);
|
61262
61264
|
const environments = {};
|
@@ -61475,13 +61477,11 @@ async function _createServer(inlineConfig = {}, options) {
|
|
61475
61477
|
process.stdin.on('end', exitProcess);
|
61476
61478
|
}
|
61477
61479
|
}
|
61478
|
-
const publicFiles = await initPublicFilesPromise;
|
61479
61480
|
const onHMRUpdate = async (type, file) => {
|
61480
61481
|
if (serverConfig.hmr !== false) {
|
61481
61482
|
await handleHMRUpdate(type, file, server);
|
61482
61483
|
}
|
61483
61484
|
};
|
61484
|
-
const { publicDir } = config;
|
61485
61485
|
const onFileAddUnlink = async (file, isUnlink) => {
|
61486
61486
|
file = normalizePath$3(file);
|
61487
61487
|
await pluginContainer.watchChange(file, {
|
@@ -64504,8 +64504,9 @@ async function transformDynamicImport(importSource, importer, resolve, root) {
|
|
64504
64504
|
if (!resolvedFileName) {
|
64505
64505
|
return null;
|
64506
64506
|
}
|
64507
|
-
const relativeFileName = posix$1.relative(posix$1.dirname(normalizePath$3(importer)), normalizePath$3(resolvedFileName));
|
64508
|
-
importSource =
|
64507
|
+
const relativeFileName = normalizePath$3(posix$1.relative(posix$1.dirname(normalizePath$3(importer)), normalizePath$3(resolvedFileName)));
|
64508
|
+
importSource =
|
64509
|
+
'`' + (relativeFileName[0] === '.' ? '' : './') + relativeFileName + '`';
|
64509
64510
|
}
|
64510
64511
|
const dynamicImportPattern = parseDynamicImportPattern(importSource);
|
64511
64512
|
if (!dynamicImportPattern) {
|
@@ -68001,7 +68002,7 @@ async function resolveBuildPlugins(config) {
|
|
68001
68002
|
* Returns a Promise containing the build result.
|
68002
68003
|
*/
|
68003
68004
|
async function build(inlineConfig = {}) {
|
68004
|
-
const builder = await
|
68005
|
+
const builder = await createBuilder(inlineConfig);
|
68005
68006
|
if (builder.config.build.lib) {
|
68006
68007
|
// TODO: temporal workaround. Should we support `libraries: Record<string, LibraryOptions & EnvironmentOptions>`
|
68007
68008
|
// to build multiple libraries and be able to target different environments (for example for a Svelte components
|
@@ -68014,16 +68015,17 @@ async function build(inlineConfig = {}) {
|
|
68014
68015
|
return builder.build(environment);
|
68015
68016
|
}
|
68016
68017
|
}
|
68017
|
-
function resolveConfigToBuild(inlineConfig = {}) {
|
68018
|
-
return resolveConfig(inlineConfig, 'build', 'production', 'production');
|
68018
|
+
function resolveConfigToBuild(inlineConfig = {}, patchConfig) {
|
68019
|
+
return resolveConfig(inlineConfig, 'build', 'production', 'production', false, patchConfig);
|
68019
68020
|
}
|
68020
68021
|
/**
|
68021
68022
|
* Build an App environment, or a App library (if librayOptions is provided)
|
68022
68023
|
**/
|
68023
68024
|
async function buildEnvironment(config, environment, libOptions = false) {
|
68024
68025
|
const options = config.build;
|
68026
|
+
const { logger } = environment;
|
68025
68027
|
const ssr = environment.name !== 'client';
|
68026
|
-
|
68028
|
+
logger.info(colors$1.cyan(`vite v${VERSION} ${colors$1.green(`building ${ssr ? `SSR bundle ` : ``}for ${config.mode}...`)}`));
|
68027
68029
|
const resolve = (p) => path$o.resolve(config.root, p);
|
68028
68030
|
const input = libOptions
|
68029
68031
|
? options.rollupOptions?.input ||
|
@@ -68085,7 +68087,7 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68085
68087
|
const outputBuildError = (e) => {
|
68086
68088
|
const msg = mergeRollupError(e);
|
68087
68089
|
clearLine();
|
68088
|
-
|
68090
|
+
logger.error(msg, { error: e });
|
68089
68091
|
};
|
68090
68092
|
let bundle;
|
68091
68093
|
let startTime;
|
@@ -68093,7 +68095,7 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68093
68095
|
const buildOutputOptions = (output = {}) => {
|
68094
68096
|
// @ts-expect-error See https://github.com/vitejs/vite/issues/5812#issuecomment-984345618
|
68095
68097
|
if (output.output) {
|
68096
|
-
|
68098
|
+
logger.warn(`You've set "rollupOptions.output.output" in your config. ` +
|
68097
68099
|
`This is deprecated and will override all Vite.js default output options. ` +
|
68098
68100
|
`Please use "rollupOptions.output" instead.`);
|
68099
68101
|
}
|
@@ -68102,7 +68104,7 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68102
68104
|
`Please use "rollupOptions.output.dir" and "rollupOptions.output.entryFileNames" instead.`);
|
68103
68105
|
}
|
68104
68106
|
if (output.sourcemap) {
|
68105
|
-
|
68107
|
+
logger.warnOnce(colors$1.yellow(`Vite does not support "rollupOptions.output.sourcemap". ` +
|
68106
68108
|
`Please use "build.sourcemap" instead.`));
|
68107
68109
|
}
|
68108
68110
|
const format = output.format || 'es';
|
@@ -68145,7 +68147,7 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68145
68147
|
};
|
68146
68148
|
};
|
68147
68149
|
// resolve lib mode outputs
|
68148
|
-
const outputs = resolveBuildOutputs(options.rollupOptions?.output, libOptions,
|
68150
|
+
const outputs = resolveBuildOutputs(options.rollupOptions?.output, libOptions, logger);
|
68149
68151
|
const normalizedOutputs = [];
|
68150
68152
|
if (Array.isArray(outputs)) {
|
68151
68153
|
for (const resolvedOutput of outputs) {
|
@@ -68156,10 +68158,10 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68156
68158
|
normalizedOutputs.push(buildOutputOptions(outputs));
|
68157
68159
|
}
|
68158
68160
|
const resolvedOutDirs = getResolvedOutDirs(config.root, options.outDir, options.rollupOptions?.output);
|
68159
|
-
const emptyOutDir = resolveEmptyOutDir(options.emptyOutDir, config.root, resolvedOutDirs,
|
68161
|
+
const emptyOutDir = resolveEmptyOutDir(options.emptyOutDir, config.root, resolvedOutDirs, logger);
|
68160
68162
|
// watch file changes with rollup
|
68161
68163
|
if (config.build.watch) {
|
68162
|
-
|
68164
|
+
logger.info(colors$1.cyan(`\nwatching for file changes...`));
|
68163
68165
|
const resolvedChokidarOptions = resolveChokidarOptions(config, config.build.watch.chokidar, resolvedOutDirs, emptyOutDir);
|
68164
68166
|
const { watch } = await import('rollup');
|
68165
68167
|
const watcher = watch({
|
@@ -68172,14 +68174,14 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68172
68174
|
});
|
68173
68175
|
watcher.on('event', (event) => {
|
68174
68176
|
if (event.code === 'BUNDLE_START') {
|
68175
|
-
|
68177
|
+
logger.info(colors$1.cyan(`\nbuild started...`));
|
68176
68178
|
if (options.write) {
|
68177
68179
|
prepareOutDir(resolvedOutDirs, emptyOutDir, config);
|
68178
68180
|
}
|
68179
68181
|
}
|
68180
68182
|
else if (event.code === 'BUNDLE_END') {
|
68181
68183
|
event.result.close();
|
68182
|
-
|
68184
|
+
logger.info(colors$1.cyan(`built in ${event.duration}ms.`));
|
68183
68185
|
}
|
68184
68186
|
else if (event.code === 'ERROR') {
|
68185
68187
|
outputBuildError(event.error);
|
@@ -68198,14 +68200,14 @@ async function buildEnvironment(config, environment, libOptions = false) {
|
|
68198
68200
|
for (const output of normalizedOutputs) {
|
68199
68201
|
res.push(await bundle[options.write ? 'write' : 'generate'](output));
|
68200
68202
|
}
|
68201
|
-
|
68203
|
+
logger.info(`${colors$1.green(`✓ built in ${displayTime(Date.now() - startTime)}`)}`);
|
68202
68204
|
return Array.isArray(outputs) ? res : res[0];
|
68203
68205
|
}
|
68204
68206
|
catch (e) {
|
68205
68207
|
e.message = mergeRollupError(e);
|
68206
68208
|
clearLine();
|
68207
68209
|
if (startTime) {
|
68208
|
-
|
68210
|
+
logger.error(`${colors$1.red('x')} Build failed in ${displayTime(Date.now() - startTime)}`);
|
68209
68211
|
startTime = undefined;
|
68210
68212
|
}
|
68211
68213
|
throw e;
|
@@ -68579,53 +68581,37 @@ class BuildEnvironment extends Environment {
|
|
68579
68581
|
super(name, config, options);
|
68580
68582
|
}
|
68581
68583
|
}
|
68582
|
-
async function
|
68584
|
+
async function defaultBuildApp(builder) {
|
68583
68585
|
for (const environment of Object.values(builder.environments)) {
|
68584
|
-
await build(environment);
|
68586
|
+
await builder.build(environment);
|
68585
68587
|
}
|
68586
68588
|
}
|
68587
68589
|
function resolveBuilderOptions(options = {}) {
|
68588
68590
|
return {
|
68589
|
-
|
68591
|
+
sharedConfigBuild: options.sharedConfigBuild ?? false,
|
68592
|
+
sharedPlugins: options.sharedPlugins ?? false,
|
68593
|
+
entireApp: options.entireApp ?? false,
|
68594
|
+
buildApp: options.buildApp ?? defaultBuildApp,
|
68590
68595
|
};
|
68591
68596
|
}
|
68592
|
-
async function
|
68593
|
-
|
68594
|
-
// from a factory to ensure each build has their own instances
|
68595
|
-
const resolveConfig = (environmentOptions) => {
|
68596
|
-
const { plugins } = defaultBuilderInlineConfig;
|
68597
|
-
let defaultInlineConfig = plugins
|
68598
|
-
? {
|
68599
|
-
...defaultBuilderInlineConfig,
|
68600
|
-
plugins: plugins(),
|
68601
|
-
}
|
68602
|
-
: defaultBuilderInlineConfig;
|
68603
|
-
if (environmentOptions) {
|
68604
|
-
defaultInlineConfig = mergeConfig(defaultInlineConfig, environmentOptions);
|
68605
|
-
}
|
68606
|
-
// We resolve the whole config including plugins here but later on we
|
68607
|
-
// need to refactor resolveConfig to only resolve the environments config
|
68608
|
-
return resolveConfigToBuild(defaultInlineConfig);
|
68609
|
-
};
|
68610
|
-
const defaultConfig = await resolveConfig();
|
68597
|
+
async function createBuilder(inlineConfig = {}) {
|
68598
|
+
const config = await resolveConfigToBuild(inlineConfig);
|
68611
68599
|
const environments = {};
|
68612
68600
|
const builder = {
|
68613
68601
|
environments,
|
68614
|
-
config
|
68615
|
-
async
|
68616
|
-
if (
|
68617
|
-
throw new Error('Watch mode is not yet supported in viteBuilder.
|
68602
|
+
config,
|
68603
|
+
async buildApp() {
|
68604
|
+
if (config.build.watch) {
|
68605
|
+
throw new Error('Watch mode is not yet supported in viteBuilder.buildApp()');
|
68618
68606
|
}
|
68619
|
-
return
|
68620
|
-
await this.build(environment);
|
68621
|
-
});
|
68607
|
+
return config.builder.buildApp(builder);
|
68622
68608
|
},
|
68623
68609
|
async build(environment) {
|
68624
68610
|
return buildEnvironment(environment.config, environment);
|
68625
68611
|
},
|
68626
68612
|
};
|
68627
|
-
for (const name of Object.keys(
|
68628
|
-
const environmentOptions =
|
68613
|
+
for (const name of Object.keys(config.environments)) {
|
68614
|
+
const environmentOptions = config.environments[name];
|
68629
68615
|
const createEnvironment = environmentOptions.build?.createEnvironment ??
|
68630
68616
|
((name, config) => new BuildEnvironment(name, config));
|
68631
68617
|
// We need to resolve the config again so we can properly merge options
|
@@ -68633,7 +68619,34 @@ async function createViteBuilder(builderOptions = {}, defaultBuilderInlineConfig
|
|
68633
68619
|
// expects plugins to be run for the same environment once they are created
|
68634
68620
|
// and to process a single bundle at a time (contrary to dev mode where
|
68635
68621
|
// plugins are built to handle multiple environments concurrently).
|
68636
|
-
|
68622
|
+
let environmentConfig = config;
|
68623
|
+
if (!config.builder.sharedConfigBuild) {
|
68624
|
+
const patchConfig = (resolved) => {
|
68625
|
+
// Force opt-in shared plugins
|
68626
|
+
const environmentPlugins = [...resolved.plugins];
|
68627
|
+
let validMixedPlugins = true;
|
68628
|
+
for (let i = 0; i < environmentPlugins.length; i++) {
|
68629
|
+
const environmentPlugin = environmentPlugins[i];
|
68630
|
+
const sharedPlugin = config.plugins[i];
|
68631
|
+
if (config.builder.sharedPlugins ||
|
68632
|
+
environmentPlugin.sharedDuringBuild) {
|
68633
|
+
if (environmentPlugin.name !== sharedPlugin.name) {
|
68634
|
+
validMixedPlugins = false;
|
68635
|
+
break;
|
68636
|
+
}
|
68637
|
+
environmentPlugins[i] = sharedPlugin;
|
68638
|
+
}
|
68639
|
+
}
|
68640
|
+
if (validMixedPlugins) {
|
68641
|
+
resolved.plugins = environmentPlugins;
|
68642
|
+
}
|
68643
|
+
resolved.build = {
|
68644
|
+
...resolved.environments[name].build,
|
68645
|
+
lib: false,
|
68646
|
+
};
|
68647
|
+
};
|
68648
|
+
environmentConfig = await resolveConfigToBuild(inlineConfig, patchConfig);
|
68649
|
+
}
|
68637
68650
|
const environment = await createEnvironment(name, environmentConfig);
|
68638
68651
|
environments[name] = environment;
|
68639
68652
|
}
|
@@ -68645,8 +68658,8 @@ var build$1 = {
|
|
68645
68658
|
BuildEnvironment: BuildEnvironment,
|
68646
68659
|
build: build,
|
68647
68660
|
buildEnvironment: buildEnvironment,
|
68661
|
+
createBuilder: createBuilder,
|
68648
68662
|
createToImportMetaURLBasedRelativeRuntime: createToImportMetaURLBasedRelativeRuntime,
|
68649
|
-
createViteBuilder: createViteBuilder,
|
68650
68663
|
injectEnvironmentToHooks: injectEnvironmentToHooks,
|
68651
68664
|
onRollupWarning: onRollupWarning,
|
68652
68665
|
resolveBuildEnvironmentOptions: resolveBuildEnvironmentOptions,
|
@@ -69048,7 +69061,7 @@ function resolveOptimizeDepsConfig(optimizeDeps, preserveSymlinks) {
|
|
69048
69061
|
disabled: optimizeDeps.disabled,
|
69049
69062
|
};
|
69050
69063
|
}
|
69051
|
-
async function resolveConfig(inlineConfig, command, defaultMode = 'development', defaultNodeEnv = 'development', isPreview = false) {
|
69064
|
+
async function resolveConfig(inlineConfig, command, defaultMode = 'development', defaultNodeEnv = 'development', isPreview = false, patchConfig = undefined) {
|
69052
69065
|
let config = inlineConfig;
|
69053
69066
|
let configFileDependencies = [];
|
69054
69067
|
let mode = inlineConfig.mode || defaultMode;
|
@@ -69125,9 +69138,9 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
69125
69138
|
// Backward compatibility: merge optimizeDeps into environments.client.dev.optimizeDeps as defaults
|
69126
69139
|
// TODO: should entries and force be in EnvironmentOptions?
|
69127
69140
|
const { entries, force, ...deprecatedClientOptimizeDepsConfig } = config.optimizeDeps ?? {};
|
69128
|
-
|
69141
|
+
const configEnvironmentsClient = config.environments.client;
|
69129
69142
|
configEnvironmentsClient.dev ??= {};
|
69130
|
-
configEnvironmentsClient.dev.optimizeDeps = mergeConfig(configEnvironmentsClient.dev.optimizeDeps ?? {}
|
69143
|
+
configEnvironmentsClient.dev.optimizeDeps = mergeConfig(deprecatedClientOptimizeDepsConfig, configEnvironmentsClient.dev.optimizeDeps ?? {});
|
69131
69144
|
const deprecatedSsrOptimizeDepsConfig = config.ssr?.optimizeDeps ?? {};
|
69132
69145
|
let configEnvironmentsSsr = config.environments.ssr;
|
69133
69146
|
// Backward compatibility: server.warmup.clientFiles/ssrFiles -> environment.dev.warmup
|
@@ -69143,7 +69156,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
69143
69156
|
// Backward compatibility: merge ssr into environments.ssr.config as defaults
|
69144
69157
|
if (configEnvironmentsSsr) {
|
69145
69158
|
configEnvironmentsSsr.dev ??= {};
|
69146
|
-
configEnvironmentsSsr.dev.optimizeDeps = mergeConfig(configEnvironmentsSsr.dev.optimizeDeps ?? {}
|
69159
|
+
configEnvironmentsSsr.dev.optimizeDeps = mergeConfig(deprecatedSsrOptimizeDepsConfig, configEnvironmentsSsr.dev.optimizeDeps ?? {});
|
69147
69160
|
// TODO: should we merge here?
|
69148
69161
|
configEnvironmentsSsr.resolve ??= {};
|
69149
69162
|
configEnvironmentsSsr.resolve.conditions ??= config.ssr?.resolve?.conditions;
|
@@ -69155,6 +69168,11 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
69155
69168
|
configEnvironmentsSsr.webCompatible = true;
|
69156
69169
|
}
|
69157
69170
|
}
|
69171
|
+
if (config.build?.ssrEmitAssets !== undefined) {
|
69172
|
+
configEnvironmentsSsr ??= {};
|
69173
|
+
configEnvironmentsSsr.build ??= {};
|
69174
|
+
configEnvironmentsSsr.build.emitAssets = config.build.ssrEmitAssets;
|
69175
|
+
}
|
69158
69176
|
// The client and ssr environment configs can't be removed by the user in the config hook
|
69159
69177
|
if (!config.environments ||
|
69160
69178
|
!config.environments.client ||
|
@@ -69173,8 +69191,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
69173
69191
|
}
|
69174
69192
|
const resolvedDefaultEnvironmentResolve = resolveEnvironmentResolveOptions(config.resolve, logger);
|
69175
69193
|
// Backward compatibility: merge environments.client.dev.optimizeDeps back into optimizeDeps
|
69176
|
-
|
69177
|
-
const patchedOptimizeDeps = mergeConfig(
|
69194
|
+
const resolvedConfigEnvironmentsClient = resolvedEnvironments.client;
|
69195
|
+
const patchedOptimizeDeps = mergeConfig(config.optimizeDeps ?? {}, resolvedConfigEnvironmentsClient.dev?.optimizeDeps ?? {});
|
69178
69196
|
const backwardCompatibleOptimizeDeps = {
|
69179
69197
|
holdUntilCrawlEnd: true,
|
69180
69198
|
...patchedOptimizeDeps,
|
@@ -69411,6 +69429,8 @@ async function resolveConfig(inlineConfig, command, defaultMode = 'development',
|
|
69411
69429
|
...resolved,
|
69412
69430
|
};
|
69413
69431
|
resolved.plugins = await resolvePlugins(resolved, prePlugins, normalPlugins, postPlugins);
|
69432
|
+
// Backward compatibility hook used in builder
|
69433
|
+
patchConfig?.(resolved);
|
69414
69434
|
Object.assign(resolved, createPluginHookUtils(resolved.plugins));
|
69415
69435
|
// call configResolved hooks
|
69416
69436
|
await Promise.all(resolved
|
@@ -69780,4 +69800,4 @@ function optimizeDepsDisabledBackwardCompatibility(resolved, optimizeDeps, optim
|
|
69780
69800
|
}
|
69781
69801
|
}
|
69782
69802
|
|
69783
|
-
export { resolveEnvPrefix as A, BuildEnvironment as B, index as C, DevEnvironment as D, build$1 as E, preview$1 as F, ServerHMRConnector as S, arraify as a, build as b, createServer as c, defineConfig as d,
|
69803
|
+
export { resolveEnvPrefix as A, BuildEnvironment as B, index as C, DevEnvironment as D, build$1 as E, preview$1 as F, ServerHMRConnector as S, arraify as a, build as b, createServer as c, defineConfig as d, createBuilder as e, formatPostcssSourceMap as f, preprocessCSS as g, buildErrorMessage as h, isInNodeModules$1 as i, createNodeDevEnvironment as j, fetchModule as k, loadConfigFromFile as l, createServerModuleRunner as m, normalizePath$3 as n, mergeConfig as o, preview as p, mergeAlias as q, resolveConfig as r, sortUserPlugins as s, transformWithEsbuild as t, createFilter as u, rollupVersion as v, send$1 as w, searchForWorkspaceRoot as x, isFileServingAllowed as y, loadEnv as z };
|
package/dist/node/cli.js
CHANGED
@@ -685,8 +685,7 @@ function cleanGlobalCLIOptions(options) {
|
|
685
685
|
*/
|
686
686
|
function cleanBuilderCLIOptions(options) {
|
687
687
|
const ret = { ...options };
|
688
|
-
delete ret.
|
689
|
-
delete ret.all;
|
688
|
+
delete ret.app;
|
690
689
|
return ret;
|
691
690
|
}
|
692
691
|
/**
|
@@ -732,7 +731,7 @@ cli
|
|
732
731
|
filterDuplicateOptions(options);
|
733
732
|
// output structure is preserved even after bundling so require()
|
734
733
|
// is ok here
|
735
|
-
const { createServer } = await import('./chunks/dep-
|
734
|
+
const { createServer } = await import('./chunks/dep-8UjKy9Ch.js').then(function (n) { return n.C; });
|
736
735
|
try {
|
737
736
|
const server = await createServer({
|
738
737
|
root,
|
@@ -810,10 +809,10 @@ cli
|
|
810
809
|
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
811
810
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
812
811
|
.option('--environment [name]', `[string] build a single environment`)
|
813
|
-
.option('--
|
812
|
+
.option('--app', `[boolean] same as builder.entireApp`)
|
814
813
|
.action(async (root, options) => {
|
815
814
|
filterDuplicateOptions(options);
|
816
|
-
const {
|
815
|
+
const { createBuilder, buildEnvironment } = await import('./chunks/dep-8UjKy9Ch.js').then(function (n) { return n.E; });
|
817
816
|
const buildOptions = cleanGlobalCLIOptions(cleanBuilderCLIOptions(options));
|
818
817
|
const config = {
|
819
818
|
root,
|
@@ -825,22 +824,19 @@ cli
|
|
825
824
|
build: buildOptions,
|
826
825
|
};
|
827
826
|
try {
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
}
|
837
|
-
else {
|
838
|
-
// --all: build all environments
|
839
|
-
await builder.buildEnvironments();
|
840
|
-
}
|
827
|
+
const builder = await createBuilder(config);
|
828
|
+
// TODO: Backward compatibility with lib and single environment build
|
829
|
+
// Ideally we would move to only building the entire app with this command
|
830
|
+
if (builder.config.build.lib) {
|
831
|
+
await buildEnvironment(builder.config, builder.environments.client, builder.config.build.lib);
|
832
|
+
}
|
833
|
+
else if (builder.config.builder.entireApp || options.app) {
|
834
|
+
await builder.buildApp();
|
841
835
|
}
|
842
836
|
else {
|
843
|
-
|
837
|
+
const ssr = !!builder.config.build.ssr;
|
838
|
+
const environment = builder.environments[ssr ? 'ssr' : 'client'];
|
839
|
+
await builder.build(environment);
|
844
840
|
}
|
845
841
|
}
|
846
842
|
catch (e) {
|
@@ -892,7 +888,7 @@ cli
|
|
892
888
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
893
889
|
.action(async (root, options) => {
|
894
890
|
filterDuplicateOptions(options);
|
895
|
-
const { preview } = await import('./chunks/dep-
|
891
|
+
const { preview } = await import('./chunks/dep-8UjKy9Ch.js').then(function (n) { return n.F; });
|
896
892
|
try {
|
897
893
|
const server = await preview({
|
898
894
|
root,
|
package/dist/node/index.d.ts
CHANGED
@@ -2936,17 +2936,17 @@ declare class BuildEnvironment extends Environment {
|
|
2936
2936
|
interface ViteBuilder {
|
2937
2937
|
environments: Record<string, BuildEnvironment>;
|
2938
2938
|
config: ResolvedConfig;
|
2939
|
-
|
2939
|
+
buildApp(): Promise<void>;
|
2940
2940
|
build(environment: BuildEnvironment): Promise<RollupOutput | RollupOutput[] | RollupWatcher>;
|
2941
2941
|
}
|
2942
2942
|
interface BuilderOptions {
|
2943
|
-
|
2943
|
+
sharedConfigBuild?: boolean;
|
2944
|
+
sharedPlugins?: boolean;
|
2945
|
+
entireApp?: boolean;
|
2946
|
+
buildApp?: (builder: ViteBuilder) => Promise<void>;
|
2944
2947
|
}
|
2945
2948
|
type ResolvedBuilderOptions = Required<BuilderOptions>;
|
2946
|
-
|
2947
|
-
plugins?: () => PluginOption[];
|
2948
|
-
}
|
2949
|
-
declare function createViteBuilder(builderOptions?: BuilderOptions, defaultBuilderInlineConfig?: BuilderInlineConfig): Promise<ViteBuilder>;
|
2949
|
+
declare function createBuilder(inlineConfig?: InlineConfig): Promise<ViteBuilder>;
|
2950
2950
|
|
2951
2951
|
interface ESBuildOptions extends esbuild_TransformOptions {
|
2952
2952
|
include?: string | RegExp | string[] | RegExp[];
|
@@ -3295,6 +3295,15 @@ interface BasePlugin<A = any> extends rollup.Plugin<A> {
|
|
3295
3295
|
}
|
3296
3296
|
type BoundedPlugin<A = any> = BasePlugin<A>;
|
3297
3297
|
interface Plugin<A = any> extends BasePlugin<A> {
|
3298
|
+
/**
|
3299
|
+
* Opt-in this plugin into the shared plugins pipeline.
|
3300
|
+
* For backward-compatibility, plugins are re-recreated for each environment
|
3301
|
+
* during `vite build --app`
|
3302
|
+
* We have an opt-in per plugin, and a general `builder.sharedPlugins`
|
3303
|
+
* In a future major, we'll flip the default to be shared by default
|
3304
|
+
* @experimental
|
3305
|
+
*/
|
3306
|
+
sharedDuringBuild?: boolean;
|
3298
3307
|
/**
|
3299
3308
|
* Spawn the plugin into multiple plugins based on the environment.
|
3300
3309
|
* This hook is called when the config has already been resolved, allowing to
|
@@ -3862,7 +3871,7 @@ interface PluginHookUtils {
|
|
3862
3871
|
getSortedPluginHooks: <K extends keyof Plugin>(hookName: K) => NonNullable<HookHandler<Plugin[K]>>[];
|
3863
3872
|
}
|
3864
3873
|
type ResolveFn = (id: string, importer?: string, aliasOnly?: boolean, ssr?: boolean) => Promise<string | undefined>;
|
3865
|
-
declare function resolveConfig(inlineConfig: InlineConfig, command: 'build' | 'serve', defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean): Promise<ResolvedConfig>;
|
3874
|
+
declare function resolveConfig(inlineConfig: InlineConfig, command: 'build' | 'serve', defaultMode?: string, defaultNodeEnv?: string, isPreview?: boolean, patchConfig?: ((config: ResolvedConfig) => void) | undefined): Promise<ResolvedConfig>;
|
3866
3875
|
declare function sortUserPlugins(plugins: (Plugin | Plugin[])[] | undefined): [Plugin[], Plugin[], Plugin[]];
|
3867
3876
|
declare function loadConfigFromFile(configEnv: ConfigEnv, configFile?: string, configRoot?: string, logLevel?: LogLevel, customLogger?: Logger): Promise<{
|
3868
3877
|
path: string;
|
@@ -3894,18 +3903,18 @@ interface ServerModuleRunnerOptions extends Omit<ModuleRunnerOptions, 'root' | '
|
|
3894
3903
|
* Create an instance of the Vite SSR runtime that support HMR.
|
3895
3904
|
* @experimental
|
3896
3905
|
*/
|
3897
|
-
declare function createServerModuleRunner(
|
3906
|
+
declare function createServerModuleRunner(environment: DevEnvironment, options?: ServerModuleRunnerOptions): ModuleRunner;
|
3898
3907
|
|
3899
3908
|
/**
|
3900
3909
|
* The connector class to establish HMR communication between the server and the Vite runtime.
|
3901
3910
|
* @experimental
|
3902
3911
|
*/
|
3903
3912
|
declare class ServerHMRConnector implements ModuleRunnerHMRConnection {
|
3904
|
-
private handlers;
|
3905
3913
|
private hmrChannel;
|
3914
|
+
private handlers;
|
3906
3915
|
private hmrClient;
|
3907
3916
|
private connected;
|
3908
|
-
constructor(
|
3917
|
+
constructor(hmrChannel: ServerHMRChannel);
|
3909
3918
|
isReady(): boolean;
|
3910
3919
|
send(message: string): void;
|
3911
3920
|
onUpdate(handler: (payload: HMRPayload) => void): void;
|
@@ -3982,4 +3991,4 @@ interface ManifestChunk {
|
|
3982
3991
|
dynamicImports?: string[];
|
3983
3992
|
}
|
3984
3993
|
|
3985
|
-
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentOptions, type DevEnvironmentSetup, type ESBuildOptions, type ESBuildTransformResult, EnvironmentModuleGraph, EnvironmentModuleNode, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotUpdateContext, type HtmlTagDescriptor, HttpProxy, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, RemoteEnvironmentTransport, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createNodeDevEnvironment, createServer, createServerModuleRunner,
|
3994
|
+
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, BuildEnvironment, type BuildEnvironmentOptions, type BuildOptions, type BuilderOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, DevEnvironment, type DevEnvironmentOptions, type DevEnvironmentSetup, type ESBuildOptions, type ESBuildTransformResult, EnvironmentModuleGraph, EnvironmentModuleNode, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HotUpdateContext, type HtmlTagDescriptor, HttpProxy, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, RemoteEnvironmentTransport, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildEnvironmentOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedDevEnvironmentOptions, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteBuilder, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createBuilder, createFilter, createLogger, createNodeDevEnvironment, createServer, createServerModuleRunner, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
|
package/dist/node/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
2
|
-
import { i as isInNodeModules, a as arraify } from './chunks/dep-
|
3
|
-
export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, h as buildErrorMessage, u as createFilter, j as createNodeDevEnvironment, c as createServer, m as createServerModuleRunner,
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-8UjKy9Ch.js';
|
3
|
+
export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, h as buildErrorMessage, e as createBuilder, u as createFilter, j as createNodeDevEnvironment, c as createServer, m as createServerModuleRunner, d as defineConfig, k as fetchModule, f as formatPostcssSourceMap, y as isFileServingAllowed, l as loadConfigFromFile, z as loadEnv, q as mergeAlias, o as mergeConfig, n as normalizePath, g as preprocessCSS, p as preview, r as resolveConfig, A as resolveEnvPrefix, v as rollupVersion, x as searchForWorkspaceRoot, w as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-8UjKy9Ch.js';
|
4
4
|
export { VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
export { c as createLogger } from './chunks/dep-C7zR1Rh8.js';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "6.0.0-alpha.
|
3
|
+
"version": "6.0.0-alpha.4",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -114,7 +114,7 @@
|
|
114
114
|
"http-proxy": "^1.18.1",
|
115
115
|
"launch-editor-middleware": "^2.6.1",
|
116
116
|
"lightningcss": "^1.24.1",
|
117
|
-
"magic-string": "^0.30.
|
117
|
+
"magic-string": "^0.30.10",
|
118
118
|
"micromatch": "^4.0.5",
|
119
119
|
"mlly": "^1.6.1",
|
120
120
|
"mrmime": "^2.0.0",
|
@@ -131,7 +131,7 @@
|
|
131
131
|
"rollup-plugin-dts": "^6.1.0",
|
132
132
|
"rollup-plugin-esbuild": "^6.1.1",
|
133
133
|
"rollup-plugin-license": "^3.3.1",
|
134
|
-
"sass": "^1.
|
134
|
+
"sass": "^1.75.0",
|
135
135
|
"sirv": "^2.0.4",
|
136
136
|
"source-map-support": "^0.5.21",
|
137
137
|
"strip-ansi": "^7.1.0",
|