vite 6.0.0-beta.5 → 6.0.0-beta.6
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/LICENSE.md +0 -21
- package/dist/client/client.mjs +23 -16
- package/dist/node/chunks/{dep-DUrICmHV.js → dep-BBdZfOY1.js} +1 -1
- package/dist/node/chunks/{dep-BW_D9zgJ.js → dep-D4jOq5eU.js} +1626 -8046
- package/dist/node/chunks/{dep-jvFrlYpX.js → dep-DmJnO2SA.js} +1 -1
- package/dist/node/cli.js +5 -5
- package/dist/node/index.d.ts +14 -74
- package/dist/node/index.js +2 -2
- package/dist/node/module-runner.js +11 -5
- package/dist/node-cjs/publicUtils.cjs +8 -4
- package/package.json +22 -9
- package/types/{cssPreprocessorOptions.d.ts → internal/cssPreprocessorOptions.d.ts} +23 -3
- package/types/internal/lightningcssOptions.d.ts +18 -0
package/dist/node/cli.js
CHANGED
@@ -2,7 +2,7 @@ import path from 'node:path';
|
|
2
2
|
import fs__default from 'node:fs';
|
3
3
|
import { performance } from 'node:perf_hooks';
|
4
4
|
import { EventEmitter } from 'events';
|
5
|
-
import { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-
|
5
|
+
import { K as colors, E as createLogger, r as resolveConfig } from './chunks/dep-D4jOq5eU.js';
|
6
6
|
import { VERSION } from './constants.js';
|
7
7
|
import 'node:fs/promises';
|
8
8
|
import 'node:url';
|
@@ -740,7 +740,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
740
740
|
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
741
741
|
).action(async (root, options) => {
|
742
742
|
filterDuplicateOptions(options);
|
743
|
-
const { createServer } = await import('./chunks/dep-
|
743
|
+
const { createServer } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.O; });
|
744
744
|
try {
|
745
745
|
const server = await createServer({
|
746
746
|
root,
|
@@ -833,7 +833,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
833
833
|
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--app", `[boolean] same as \`builder: {}\``).action(
|
834
834
|
async (root, options) => {
|
835
835
|
filterDuplicateOptions(options);
|
836
|
-
const { createBuilder } = await import('./chunks/dep-
|
836
|
+
const { createBuilder } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.P; });
|
837
837
|
const buildOptions = cleanGlobalCLIOptions(
|
838
838
|
cleanBuilderCLIOptions(options)
|
839
839
|
);
|
@@ -868,7 +868,7 @@ cli.command("optimize [root]", "pre-bundle dependencies").option(
|
|
868
868
|
).action(
|
869
869
|
async (root, options) => {
|
870
870
|
filterDuplicateOptions(options);
|
871
|
-
const { optimizeDeps } = await import('./chunks/dep-
|
871
|
+
const { optimizeDeps } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.N; });
|
872
872
|
try {
|
873
873
|
const config = await resolveConfig(
|
874
874
|
{
|
@@ -894,7 +894,7 @@ ${e.stack}`),
|
|
894
894
|
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
|
895
895
|
async (root, options) => {
|
896
896
|
filterDuplicateOptions(options);
|
897
|
-
const { preview } = await import('./chunks/dep-
|
897
|
+
const { preview } = await import('./chunks/dep-D4jOq5eU.js').then(function (n) { return n.Q; });
|
898
898
|
try {
|
899
899
|
const server = await preview({
|
900
900
|
root,
|
package/dist/node/index.d.ts
CHANGED
@@ -26,7 +26,9 @@ export { CustomEventMap, InferCustomEventPayload, InvalidatePayload } from '../.
|
|
26
26
|
import { SecureContextOptions } from 'node:tls';
|
27
27
|
import { ZlibOptions } from 'node:zlib';
|
28
28
|
import * as PostCSS from 'postcss';
|
29
|
-
import {
|
29
|
+
import { LightningCSSOptions } from '../../types/internal/lightningcssOptions.js';
|
30
|
+
export { LightningCSSOptions } from '../../types/internal/lightningcssOptions.js';
|
31
|
+
import { SassLegacyPreprocessBaseOptions, SassModernPreprocessBaseOptions, LessPreprocessorBaseOptions, StylusPreprocessorBaseOptions } from '../../types/internal/cssPreprocessorOptions.js';
|
30
32
|
export { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownAsTypeMap } from '../../types/importGlob.js';
|
31
33
|
export { ChunkMetadata } from '../../types/metadata.js';
|
32
34
|
|
@@ -650,6 +652,7 @@ interface LoggerOptions {
|
|
650
652
|
prefix?: string;
|
651
653
|
allowClearScreen?: boolean;
|
652
654
|
customLogger?: Logger;
|
655
|
+
console?: Console;
|
653
656
|
}
|
654
657
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
655
658
|
|
@@ -1129,6 +1132,7 @@ declare class ModuleGraph {
|
|
1129
1132
|
idToModuleMap: Map<string, ModuleNode>;
|
1130
1133
|
etagToModuleMap: Map<string, ModuleNode>;
|
1131
1134
|
fileToModulesMap: Map<string, Set<ModuleNode>>;
|
1135
|
+
private moduleNodeCache;
|
1132
1136
|
constructor(moduleGraphs: {
|
1133
1137
|
client: () => EnvironmentModuleGraph;
|
1134
1138
|
ssr: () => EnvironmentModuleGraph;
|
@@ -3075,69 +3079,6 @@ type ESBuildTransformResult = Omit<esbuild_TransformResult, 'map'> & {
|
|
3075
3079
|
};
|
3076
3080
|
declare function transformWithEsbuild(code: string, filename: string, options?: esbuild_TransformOptions, inMap?: object): Promise<ESBuildTransformResult>;
|
3077
3081
|
|
3078
|
-
// This file is autogenerated by build-prefixes.js. DO NOT EDIT!
|
3079
|
-
|
3080
|
-
interface Targets {
|
3081
|
-
android?: number,
|
3082
|
-
chrome?: number,
|
3083
|
-
edge?: number,
|
3084
|
-
firefox?: number,
|
3085
|
-
ie?: number,
|
3086
|
-
ios_saf?: number,
|
3087
|
-
opera?: number,
|
3088
|
-
safari?: number,
|
3089
|
-
samsung?: number
|
3090
|
-
}
|
3091
|
-
|
3092
|
-
interface Drafts {
|
3093
|
-
/** Whether to enable @custom-media rules. */
|
3094
|
-
customMedia?: boolean
|
3095
|
-
}
|
3096
|
-
|
3097
|
-
interface NonStandard {
|
3098
|
-
/** Whether to enable the non-standard >>> and /deep/ selector combinators used by Angular and Vue. */
|
3099
|
-
deepSelectorCombinator?: boolean
|
3100
|
-
}
|
3101
|
-
|
3102
|
-
interface PseudoClasses {
|
3103
|
-
hover?: string,
|
3104
|
-
active?: string,
|
3105
|
-
focus?: string,
|
3106
|
-
focusVisible?: string,
|
3107
|
-
focusWithin?: string
|
3108
|
-
}
|
3109
|
-
|
3110
|
-
interface CSSModulesConfig {
|
3111
|
-
/** The pattern to use when renaming class names and other identifiers. Default is `[hash]_[local]`. */
|
3112
|
-
pattern?: string,
|
3113
|
-
/** Whether to rename dashed identifiers, e.g. custom properties. */
|
3114
|
-
dashedIdents?: boolean,
|
3115
|
-
/** Whether to enable hashing for `@keyframes`. */
|
3116
|
-
animation?: boolean,
|
3117
|
-
/** Whether to enable hashing for CSS grid identifiers. */
|
3118
|
-
grid?: boolean,
|
3119
|
-
/** Whether to enable hashing for custom identifiers. */
|
3120
|
-
customIdents?: boolean,
|
3121
|
-
/** Whether to require at least one class or id selector in each rule. */
|
3122
|
-
pure?: boolean
|
3123
|
-
}
|
3124
|
-
|
3125
|
-
/**
|
3126
|
-
* Options are spread, so you can also use options that are not typed here like
|
3127
|
-
* visitor (not exposed because it would impact too much the bundle size)
|
3128
|
-
*/
|
3129
|
-
type LightningCSSOptions = {
|
3130
|
-
targets?: Targets
|
3131
|
-
include?: number
|
3132
|
-
exclude?: number
|
3133
|
-
drafts?: Drafts
|
3134
|
-
nonStandard?: NonStandard
|
3135
|
-
pseudoClasses?: PseudoClasses
|
3136
|
-
unusedSymbols?: string[]
|
3137
|
-
cssModules?: CSSModulesConfig
|
3138
|
-
errorRecovery?: boolean
|
3139
|
-
}
|
3140
|
-
|
3141
3082
|
interface CSSOptions {
|
3142
3083
|
/**
|
3143
3084
|
* Using lightningcss is an experimental option to handle CSS modules,
|
@@ -3200,9 +3141,7 @@ interface CSSModulesOptions {
|
|
3200
3141
|
localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly' | ((originalClassName: string, generatedClassName: string, inputFile: string) => string);
|
3201
3142
|
}
|
3202
3143
|
type ResolvedCSSOptions = Omit<CSSOptions, 'lightningcss'> & {
|
3203
|
-
lightningcss?: LightningCSSOptions
|
3204
|
-
targets: LightningCSSOptions['targets'];
|
3205
|
-
};
|
3144
|
+
lightningcss?: LightningCSSOptions;
|
3206
3145
|
};
|
3207
3146
|
interface PreprocessCSSResult {
|
3208
3147
|
code: string;
|
@@ -3223,9 +3162,9 @@ type PreprocessorAdditionalData = string | ((source: string, filename: string) =
|
|
3223
3162
|
type SassPreprocessorOptions = {
|
3224
3163
|
additionalData?: PreprocessorAdditionalData;
|
3225
3164
|
} & (({
|
3226
|
-
api
|
3165
|
+
api: 'legacy';
|
3227
3166
|
} & SassLegacyPreprocessBaseOptions) | ({
|
3228
|
-
api
|
3167
|
+
api?: 'modern' | 'modern-compiler';
|
3229
3168
|
} & SassModernPreprocessBaseOptions));
|
3230
3169
|
type LessPreprocessorOptions = {
|
3231
3170
|
additionalData?: PreprocessorAdditionalData;
|
@@ -3615,10 +3554,6 @@ interface DevEnvironmentOptions {
|
|
3615
3554
|
* sourcemap path and returns whether to ignore the source path.
|
3616
3555
|
*/
|
3617
3556
|
sourcemapIgnoreList?: false | ((sourcePath: string, sourcemapPath: string) => boolean);
|
3618
|
-
/**
|
3619
|
-
* Optimize deps config
|
3620
|
-
*/
|
3621
|
-
optimizeDeps?: DepOptimizationOptions;
|
3622
3557
|
/**
|
3623
3558
|
* create the Dev Environment instance
|
3624
3559
|
*/
|
@@ -3661,6 +3596,10 @@ interface SharedEnvironmentOptions {
|
|
3661
3596
|
* Temporal options, we should remove these in favor of fine-grained control
|
3662
3597
|
*/
|
3663
3598
|
webCompatible?: boolean;
|
3599
|
+
/**
|
3600
|
+
* Optimize deps config
|
3601
|
+
*/
|
3602
|
+
optimizeDeps?: DepOptimizationOptions;
|
3664
3603
|
}
|
3665
3604
|
interface EnvironmentOptions extends SharedEnvironmentOptions {
|
3666
3605
|
/**
|
@@ -3678,6 +3617,7 @@ type ResolvedEnvironmentOptions = {
|
|
3678
3617
|
resolve: ResolvedResolveOptions;
|
3679
3618
|
consumer: 'client' | 'server';
|
3680
3619
|
webCompatible: boolean;
|
3620
|
+
optimizeDeps: DepOptimizationOptions;
|
3681
3621
|
dev: ResolvedDevEnvironmentOptions;
|
3682
3622
|
build: ResolvedBuildEnvironmentOptions;
|
3683
3623
|
};
|
@@ -4122,4 +4062,4 @@ interface ManifestChunk {
|
|
4122
4062
|
dynamicImports?: string[];
|
4123
4063
|
}
|
4124
4064
|
|
4125
|
-
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 DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type EnvironmentOptions, 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 HotChannel, type HotChannelClient, type HotUpdateOptions, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type
|
4065
|
+
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 DevEnvironmentContext, type DevEnvironmentOptions, type ESBuildOptions, type ESBuildTransformResult, type Environment, EnvironmentModuleGraph, EnvironmentModuleNode, type EnvironmentOptions, 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 HotChannel, type HotChannelClient, type HotUpdateOptions, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LessPreprocessorOptions, type LibraryFormats, type LibraryOptions, 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 ModuleRunnerTransformOptions, type OptimizedDepInfo, type Plugin, 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, RunnableDevEnvironment, type RunnableDevEnvironmentContext, type SSROptions, type SSRTarget, type SassPreprocessorOptions, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerHotChannel, type ServerModuleRunnerOptions, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationConfig, type StylusPreprocessorOptions, 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, createIdResolver, createLogger, createRunnableDevEnvironment, createServer, createServerHotChannel, createServerModuleRunner, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, isRunnableDevEnvironment, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, ssrTransform as moduleRunnerTransform, normalizePath, optimizeDeps, 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, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-
|
2
|
+
import { i as isInNodeModules, a as arraify } from './chunks/dep-D4jOq5eU.js';
|
3
|
+
export { B as BuildEnvironment, D as DevEnvironment, S as ServerHMRConnector, b as build, j as buildErrorMessage, e as createBuilder, z as createFilter, f as createIdResolver, E as createLogger, k as createRunnableDevEnvironment, c as createServer, u as createServerHotChannel, q as createServerModuleRunner, d as defineConfig, n as fetchModule, g as formatPostcssSourceMap, H as isFileLoadingAllowed, G as isFileServingAllowed, m as isRunnableDevEnvironment, l as loadConfigFromFile, I as loadEnv, y as mergeAlias, x as mergeConfig, v as moduleRunnerTransform, w as normalizePath, o as optimizeDeps, h as preprocessCSS, p as preview, r as resolveConfig, J as resolveEnvPrefix, A as rollupVersion, F as searchForWorkspaceRoot, C as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-D4jOq5eU.js';
|
4
4
|
export { VERSION as version } from './constants.js';
|
5
5
|
export { version as esbuildVersion } from 'esbuild';
|
6
6
|
import 'node:fs';
|
@@ -17,11 +17,17 @@ function isPrimitive(value) {
|
|
17
17
|
return !value || typeof value != "object" && typeof value != "function";
|
18
18
|
}
|
19
19
|
const AsyncFunction = async function() {
|
20
|
-
}.constructor
|
21
|
-
|
22
|
-
|
20
|
+
}.constructor;
|
21
|
+
let asyncFunctionDeclarationPaddingLineCount;
|
22
|
+
function getAsyncFunctionDeclarationPaddingLineCount() {
|
23
|
+
if (typeof asyncFunctionDeclarationPaddingLineCount > "u") {
|
24
|
+
const body = "/*code*/", source = new AsyncFunction("a", "b", body).toString();
|
25
|
+
asyncFunctionDeclarationPaddingLineCount = source.slice(0, source.indexOf(body)).split(`
|
23
26
|
`).length - 1;
|
24
|
-
}
|
27
|
+
}
|
28
|
+
return asyncFunctionDeclarationPaddingLineCount;
|
29
|
+
}
|
30
|
+
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
25
31
|
function normalizeWindowsPath(input = "") {
|
26
32
|
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
27
33
|
}
|
@@ -1052,7 +1058,7 @@ function exportAll(exports, sourceModule) {
|
|
1052
1058
|
}
|
1053
1059
|
}
|
1054
1060
|
class ESModulesEvaluator {
|
1055
|
-
startOffset =
|
1061
|
+
startOffset = getAsyncFunctionDeclarationPaddingLineCount();
|
1056
1062
|
async runInlinedModule(context, code) {
|
1057
1063
|
await new AsyncFunction(
|
1058
1064
|
ssrModuleExportsKey,
|
@@ -5650,7 +5650,11 @@ function createLogger(level = "info", options = {}) {
|
|
5650
5650
|
return options.customLogger;
|
5651
5651
|
}
|
5652
5652
|
const loggedErrors = /* @__PURE__ */ new WeakSet();
|
5653
|
-
const {
|
5653
|
+
const {
|
5654
|
+
prefix = "[vite]",
|
5655
|
+
allowClearScreen = true,
|
5656
|
+
console: console2 = globalThis.console
|
5657
|
+
} = options;
|
5654
5658
|
const thresh = LogLevels[level];
|
5655
5659
|
const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
|
5656
5660
|
const clear = canClearScreen ? clearScreen : () => {
|
@@ -5681,7 +5685,7 @@ function createLogger(level = "info", options = {}) {
|
|
5681
5685
|
if (type === lastType && msg === lastMsg) {
|
5682
5686
|
sameCount++;
|
5683
5687
|
clear();
|
5684
|
-
|
5688
|
+
console2[method](
|
5685
5689
|
format(type, msg, options2),
|
5686
5690
|
colors.yellow(`(x${sameCount + 1})`)
|
5687
5691
|
);
|
@@ -5692,10 +5696,10 @@ function createLogger(level = "info", options = {}) {
|
|
5692
5696
|
if (options2.clear) {
|
5693
5697
|
clear();
|
5694
5698
|
}
|
5695
|
-
|
5699
|
+
console2[method](format(type, msg, options2));
|
5696
5700
|
}
|
5697
5701
|
} else {
|
5698
|
-
|
5702
|
+
console2[method](format(type, msg, options2));
|
5699
5703
|
}
|
5700
5704
|
}
|
5701
5705
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite",
|
3
|
-
"version": "6.0.0-beta.
|
3
|
+
"version": "6.0.0-beta.6",
|
4
4
|
"type": "module",
|
5
5
|
"license": "MIT",
|
6
6
|
"author": "Evan You",
|
@@ -40,6 +40,7 @@
|
|
40
40
|
"./types/*": {
|
41
41
|
"types": "./types/*"
|
42
42
|
},
|
43
|
+
"./types/internal/*": null,
|
43
44
|
"./package.json": "./package.json"
|
44
45
|
},
|
45
46
|
"typesVersions": {
|
@@ -81,15 +82,15 @@
|
|
81
82
|
},
|
82
83
|
"devDependencies": {
|
83
84
|
"@ampproject/remapping": "^2.3.0",
|
84
|
-
"@babel/parser": "^7.
|
85
|
+
"@babel/parser": "^7.26.1",
|
85
86
|
"@jridgewell/trace-mapping": "^0.3.25",
|
86
87
|
"@polka/compression": "^1.0.0-next.25",
|
87
88
|
"@rollup/plugin-alias": "^5.1.1",
|
88
89
|
"@rollup/plugin-commonjs": "^28.0.1",
|
89
|
-
"@rollup/plugin-dynamic-import-vars": "
|
90
|
+
"@rollup/plugin-dynamic-import-vars": "2.1.4",
|
90
91
|
"@rollup/plugin-json": "^6.1.0",
|
91
92
|
"@rollup/plugin-node-resolve": "15.3.0",
|
92
|
-
"@rollup/pluginutils": "^5.1.
|
93
|
+
"@rollup/pluginutils": "^5.1.3",
|
93
94
|
"@types/escape-html": "^1.0.4",
|
94
95
|
"@types/pnpapi": "^0.0.5",
|
95
96
|
"artichokie": "^0.2.1",
|
@@ -122,19 +123,19 @@
|
|
122
123
|
"picocolors": "^1.1.1",
|
123
124
|
"picomatch": "^4.0.2",
|
124
125
|
"postcss-import": "^16.1.0",
|
125
|
-
"postcss-load-config": "^
|
126
|
+
"postcss-load-config": "^6.0.1",
|
126
127
|
"postcss-modules": "^6.0.0",
|
127
128
|
"resolve.exports": "^2.0.2",
|
128
129
|
"rollup-plugin-dts": "^6.1.1",
|
129
130
|
"rollup-plugin-esbuild": "^6.1.1",
|
130
131
|
"rollup-plugin-license": "^3.5.3",
|
131
|
-
"sass": "^1.80.
|
132
|
-
"sass-embedded": "^1.80.
|
132
|
+
"sass": "^1.80.4",
|
133
|
+
"sass-embedded": "^1.80.4",
|
133
134
|
"sirv": "^3.0.0",
|
134
135
|
"source-map-support": "^0.5.21",
|
135
136
|
"strip-ansi": "^7.1.0",
|
136
137
|
"strip-literal": "^2.1.0",
|
137
|
-
"tinyglobby": "^0.2.
|
138
|
+
"tinyglobby": "^0.2.10",
|
138
139
|
"tsconfck": "^3.1.4",
|
139
140
|
"tslib": "^2.8.0",
|
140
141
|
"types": "link:./types",
|
@@ -143,18 +144,24 @@
|
|
143
144
|
},
|
144
145
|
"peerDependencies": {
|
145
146
|
"@types/node": "^18.0.0 || >=20.0.0",
|
147
|
+
"jiti": ">=1.21.0",
|
146
148
|
"less": "*",
|
147
149
|
"lightningcss": "^1.21.0",
|
148
150
|
"sass": "*",
|
149
151
|
"sass-embedded": "*",
|
150
152
|
"stylus": "*",
|
151
153
|
"sugarss": "*",
|
152
|
-
"terser": "^5.16.0"
|
154
|
+
"terser": "^5.16.0",
|
155
|
+
"tsx": "^4.8.1",
|
156
|
+
"yaml": "^2.4.2"
|
153
157
|
},
|
154
158
|
"peerDependenciesMeta": {
|
155
159
|
"@types/node": {
|
156
160
|
"optional": true
|
157
161
|
},
|
162
|
+
"jiti": {
|
163
|
+
"optional": true
|
164
|
+
},
|
158
165
|
"sass": {
|
159
166
|
"optional": true
|
160
167
|
},
|
@@ -175,6 +182,12 @@
|
|
175
182
|
},
|
176
183
|
"terser": {
|
177
184
|
"optional": true
|
185
|
+
},
|
186
|
+
"tsx": {
|
187
|
+
"optional": true
|
188
|
+
},
|
189
|
+
"yaml": {
|
190
|
+
"optional": true
|
178
191
|
}
|
179
192
|
},
|
180
193
|
"scripts": {
|
@@ -1,7 +1,9 @@
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2
2
|
|
3
3
|
// @ts-ignore `sass` may not be installed
|
4
|
-
import type
|
4
|
+
import type DartSass from 'sass'
|
5
|
+
// @ts-ignore `sass-embedded` may not be installed
|
6
|
+
import type SassEmbedded from 'sass-embedded'
|
5
7
|
// @ts-ignore `less` may not be installed
|
6
8
|
import type Less from 'less'
|
7
9
|
// @ts-ignore `less` may not be installed
|
@@ -9,8 +11,19 @@ import type Stylus from 'stylus'
|
|
9
11
|
|
10
12
|
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
11
13
|
|
14
|
+
// https://github.com/type-challenges/type-challenges/issues/29285
|
15
|
+
type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false
|
16
|
+
|
17
|
+
type DartSassLegacyStringOptionsAsync = DartSass.LegacyStringOptions<'async'>
|
18
|
+
type SassEmbeddedLegacyStringOptionsAsync =
|
19
|
+
SassEmbedded.LegacyStringOptions<'async'>
|
20
|
+
type SassLegacyStringOptionsAsync =
|
21
|
+
IsAny<DartSassLegacyStringOptionsAsync> extends false
|
22
|
+
? DartSassLegacyStringOptionsAsync
|
23
|
+
: SassEmbeddedLegacyStringOptionsAsync
|
24
|
+
|
12
25
|
export type SassLegacyPreprocessBaseOptions = Omit<
|
13
|
-
|
26
|
+
SassLegacyStringOptionsAsync,
|
14
27
|
| 'data'
|
15
28
|
| 'file'
|
16
29
|
| 'outFile'
|
@@ -20,8 +33,15 @@ export type SassLegacyPreprocessBaseOptions = Omit<
|
|
20
33
|
| 'sourceMapRoot'
|
21
34
|
>
|
22
35
|
|
36
|
+
type DartSassStringOptionsAsync = DartSass.StringOptions<'async'>
|
37
|
+
type SassEmbeddedStringOptionsAsync = SassEmbedded.StringOptions<'async'>
|
38
|
+
type SassStringOptionsAsync =
|
39
|
+
IsAny<DartSassStringOptionsAsync> extends false
|
40
|
+
? DartSassStringOptionsAsync
|
41
|
+
: SassEmbeddedStringOptionsAsync
|
42
|
+
|
23
43
|
export type SassModernPreprocessBaseOptions = Omit<
|
24
|
-
|
44
|
+
SassStringOptionsAsync,
|
25
45
|
'url' | 'sourceMap'
|
26
46
|
>
|
27
47
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2
|
+
|
3
|
+
// @ts-ignore `sass` may not be installed
|
4
|
+
import type Lightningcss from 'lightningcss'
|
5
|
+
|
6
|
+
/* eslint-enable @typescript-eslint/ban-ts-comment */
|
7
|
+
|
8
|
+
export type LightningCSSOptions = Omit<
|
9
|
+
Lightningcss.BundleAsyncOptions<Lightningcss.CustomAtRules>,
|
10
|
+
| 'filename'
|
11
|
+
| 'resolver'
|
12
|
+
| 'minify'
|
13
|
+
| 'sourceMap'
|
14
|
+
| 'analyzeDependencies'
|
15
|
+
// properties not overridden by Vite, but does not make sense to set by end users
|
16
|
+
| 'inputSourceMap'
|
17
|
+
| 'projectRoot'
|
18
|
+
>
|