Comparing version 0.14.0-snapshot-d18e8cb-20241112003342 to 0.14.0-snapshot-d42ea8a-20241202003632
@@ -6,2 +6,14 @@ type MaybePromise<T> = T | Promise<T> | ||
export declare class BindingBundleEndEventData { | ||
output: string | ||
duration: number | ||
} | ||
export declare class BindingCallableBuiltinPlugin { | ||
constructor(plugin: BindingBuiltinPlugin) | ||
resolveId(id: string, importer?: string | undefined | null, options?: BindingHookJsResolveIdOptions | undefined | null): Promise<BindingHookJsResolveIdOutput | null> | ||
load(id: string): Promise<BindingHookJsLoadOutput | null> | ||
watchChange(path: string, event: BindingJsWatchChangeEvent): Promise<void> | ||
} | ||
export declare class BindingLog { | ||
@@ -22,2 +34,33 @@ code: string | ||
export declare class BindingNormalizedOptions { | ||
get input(): Array<string> | Record<string, string> | ||
get cwd(): string | null | ||
get platform(): 'node' | 'browser' | 'neutral' | ||
get shimMissingExports(): boolean | ||
get name(): string | null | ||
get cssEntryFilenames(): string | undefined | ||
get cssChunkFilenames(): string | undefined | ||
get entryFilenames(): string | undefined | ||
get chunkFilenames(): string | undefined | ||
get assetFilenames(): string | ||
get dir(): string | null | ||
get file(): string | null | ||
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd' | ||
get exports(): 'default' | 'named' | 'none' | 'auto' | ||
get esModule(): boolean | 'if-default-prop' | ||
get inlineDynamicImports(): boolean | ||
get sourcemap(): boolean | 'inline' | 'hidden' | ||
get banner(): string | undefined | null | undefined | ||
get footer(): string | undefined | null | undefined | ||
get intro(): string | undefined | null | undefined | ||
get outro(): string | undefined | null | undefined | ||
get externalLiveBindings(): boolean | ||
get extend(): boolean | ||
get globals(): Record<string, string> | undefined | ||
get hashCharacters(): 'base64' | 'base36' | 'hex' | ||
get sourcemapDebugIds(): boolean | ||
get minify(): boolean | ||
get comments(): 'none' | 'preserve-legal' | ||
} | ||
export declare class BindingOutputAsset { | ||
@@ -50,5 +93,7 @@ get fileName(): string | ||
get assets(): Array<BindingOutputAsset> | ||
get errors(): Array<unknown> | ||
} | ||
export declare class BindingPluginContext { | ||
load(specifier: string, sideEffects: BindingHookSideEffects | undefined, fn: () => void): Promise<void> | ||
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null> | ||
@@ -62,3 +107,8 @@ emitFile(file: BindingEmittedAsset): string | ||
export declare class BindingRenderedModule { | ||
get code(): string | null | ||
} | ||
export declare class BindingTransformPluginContext { | ||
getCombinedSourcemap(): string | ||
inner(): BindingPluginContext | ||
@@ -69,5 +119,18 @@ } | ||
close(): Promise<void> | ||
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void | ||
start(listener: (data: BindingWatcherEvent) => void): Promise<void> | ||
} | ||
export declare class BindingWatcherChangeData { | ||
path: string | ||
kind: string | ||
} | ||
export declare class BindingWatcherEvent { | ||
eventKind(): string | ||
watchChangeData(): BindingWatcherChangeData | ||
bundleEndData(): BindingBundleEndEventData | ||
bundleEventKind(): string | ||
errors(): Array<unknown> | ||
} | ||
export declare class Bundler { | ||
@@ -77,5 +140,6 @@ constructor(inputOptions: BindingInputOptions, outputOptions: BindingOutputOptions, parallelPluginsRegistry?: ParallelJsPluginRegistry | undefined | null) | ||
generate(): Promise<BindingOutputs> | ||
scan(): Promise<void> | ||
scan(): Promise<BindingOutputs> | ||
close(): Promise<void> | ||
watch(): Promise<BindingWatcher> | ||
get closed(): boolean | ||
} | ||
@@ -138,16 +202,15 @@ | ||
export declare enum BindingBuiltinPluginName { | ||
WasmHelperPlugin = 0, | ||
ImportGlobPlugin = 1, | ||
DynamicImportVarsPlugin = 2, | ||
ModulePreloadPolyfillPlugin = 3, | ||
ManifestPlugin = 4, | ||
LoadFallbackPlugin = 5, | ||
TransformPlugin = 6, | ||
WasmFallbackPlugin = 7, | ||
AliasPlugin = 8, | ||
JsonPlugin = 9, | ||
BuildImportAnalysisPlugin = 10, | ||
ReplacePlugin = 11 | ||
} | ||
export type BindingBuiltinPluginName = 'builtin:wasm-helper'| | ||
'builtin:import-glob'| | ||
'builtin:dynamic-import-vars'| | ||
'builtin:module-preload-polyfill'| | ||
'builtin:manifest'| | ||
'builtin:load-fallback'| | ||
'builtin:transform'| | ||
'builtin:wasm-fallback'| | ||
'builtin:alias'| | ||
'builtin:json'| | ||
'builtin:build-import-analysis'| | ||
'builtin:replace'| | ||
'builtin:vite-resolve'; | ||
@@ -164,2 +227,4 @@ export interface BindingEmittedAsset { | ||
disableLiveBindings?: boolean | ||
viteMode?: boolean | ||
resolveNewUrlToAsset?: boolean | ||
} | ||
@@ -177,2 +242,18 @@ | ||
export interface BindingHookJsLoadOutput { | ||
code: string | ||
map?: string | ||
sideEffects: boolean | 'no-treeshake' | ||
} | ||
export interface BindingHookJsResolveIdOptions { | ||
scan?: boolean | ||
} | ||
export interface BindingHookJsResolveIdOutput { | ||
id: string | ||
external?: boolean | ||
sideEffects: boolean | 'no-treeshake' | ||
} | ||
export interface BindingHookLoadOutput { | ||
@@ -240,3 +321,3 @@ code: string | ||
platform?: 'node' | 'browser' | 'neutral' | ||
logLevel?: BindingLogLevel | ||
logLevel: BindingLogLevel | ||
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void | ||
@@ -269,2 +350,6 @@ cwd: string | ||
export interface BindingJsWatchChangeEvent { | ||
event: string | ||
} | ||
export declare enum BindingLogLevel { | ||
@@ -320,4 +405,4 @@ Silent = 0, | ||
footer?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>> | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | ||
globals?: Record<string, string> | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | 'app' | ||
globals?: Record<string, string> | ((name: string) => string) | ||
hashCharacters?: 'base64' | 'base36' | 'hex' | ||
@@ -354,3 +439,3 @@ inlineDynamicImports?: boolean | ||
name: string | ||
buildStart?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable> | ||
buildStartMeta?: BindingPluginHookMeta | ||
@@ -372,13 +457,13 @@ resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>> | ||
buildEndMeta?: BindingPluginHookMeta | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunkMeta?: BindingPluginHookMeta | ||
augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string> | ||
augmentChunkHashMeta?: BindingPluginHookMeta | ||
renderStart?: (ctx: BindingPluginContext) => void | ||
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void | ||
renderStartMeta?: BindingPluginHookMeta | ||
renderError?: (ctx: BindingPluginContext, error: string) => void | ||
renderErrorMeta?: BindingPluginHookMeta | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundleMeta?: BindingPluginHookMeta | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundleMeta?: BindingPluginHookMeta | ||
@@ -411,6 +496,2 @@ closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
export interface BindingRenderedModule { | ||
code?: string | ||
} | ||
export interface BindingReplacePluginConfig { | ||
@@ -456,2 +537,3 @@ values: Record<string, string> | ||
jsxInject?: string | ||
reactRefresh?: boolean | ||
targets?: string | ||
@@ -462,11 +544,33 @@ } | ||
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ||
annotations?: boolean | ||
} | ||
export declare enum BindingWatcherEvent { | ||
Close = 0, | ||
Event = 1, | ||
ReStart = 2, | ||
Change = 3 | ||
export interface BindingViteResolvePluginConfig { | ||
resolveOptions: BindingViteResolvePluginResolveOptions | ||
environmentConsumer: string | ||
environmentName: string | ||
external: true | string[] | ||
noExternal: true | string[] | ||
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string> | ||
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string> | ||
runtime: string | ||
} | ||
export interface BindingViteResolvePluginResolveOptions { | ||
isBuild: boolean | ||
isProduction: boolean | ||
asSrc: boolean | ||
preferRelative: boolean | ||
isRequire?: boolean | ||
root: string | ||
scan: boolean | ||
mainFields: Array<string> | ||
conditions: Array<string> | ||
externalConditions: Array<string> | ||
extensions: Array<string> | ||
tryIndex: boolean | ||
tryPrefix?: string | ||
preserveSymlinks: boolean | ||
} | ||
export interface BindingWatchOption { | ||
@@ -629,3 +733,3 @@ skipWrite?: boolean | ||
* | ||
* Conforms to the implementation in {@link https://github.com/facebook/react/tree/main/packages/react-refresh} | ||
* Conforms to the implementation in {@link https://github.com/facebook/react/tree/v18.3.1/packages/react-refresh} | ||
* | ||
@@ -730,2 +834,17 @@ * @default false | ||
jsx?: JsxOptions | ||
/** | ||
* Sets the target environment for the generated JavaScript. | ||
* | ||
* The lowest target is `es2015`. | ||
* | ||
* Example: | ||
* | ||
* * 'es2015' | ||
* * ['es2020', 'chrome58', 'edge16', 'firefox57', 'node12', 'safari11'] | ||
* | ||
* @default `esnext` (No transformation) | ||
* | ||
* @see [esbuild#target](https://esbuild.github.io/api/#target) | ||
*/ | ||
target?: string | Array<string> | ||
/** Define Plugin */ | ||
@@ -732,0 +851,0 @@ define?: Record<string, string> |
import { CliOptions } from './schema'; | ||
import type { InputOptions } from '../../types/input-options'; | ||
import type { OutputOptions } from '../../types/output-options'; | ||
import type { InputOptions } from '../../options/input-options'; | ||
import type { OutputOptions } from '../../options/output-options'; | ||
export interface NormalizedCliOptions { | ||
@@ -5,0 +5,0 @@ input: InputOptions; |
@@ -10,3 +10,3 @@ import type { ObjectSchema } from './types'; | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodArray<z.ZodType<import("../../plugin").RolldownPluginRec, z.ZodTypeDef, import("../../plugin").RolldownPluginRec>, "many">>; | ||
plugins: z.ZodOptional<z.ZodType<import("../../plugin").RolldownPluginOption, z.ZodTypeDef, import("../../plugin").RolldownPluginOption>>; | ||
external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>; | ||
@@ -60,17 +60,18 @@ resolve: z.ZodOptional<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
@@ -83,17 +84,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
@@ -106,17 +108,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
@@ -131,5 +134,7 @@ logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
resolveNewUrlToAsset: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -139,2 +144,3 @@ }, { | ||
disableLiveBindings?: boolean | undefined; | ||
resolveNewUrlToAsset?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
@@ -209,3 +215,3 @@ }>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">>, Omit<z.objectUtil.extendShape<{ | ||
}>, "plugins" | "onLog" | "onwarn" | "input" | "resolve" | "watch" | "experimental" | "profilerNames">>, Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
@@ -232,3 +238,3 @@ file: z.ZodOptional<z.ZodString>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
@@ -286,2 +292,3 @@ inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
@@ -298,30 +305,10 @@ minSize: z.ZodOptional<z.ZodNumber>; | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: boolean | undefined; | ||
dropLabels?: string[] | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
@@ -332,2 +319,3 @@ minSize?: number | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
@@ -343,19 +331,6 @@ format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
version?: boolean | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
@@ -370,12 +345,24 @@ development?: boolean | undefined; | ||
} | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
version?: boolean | undefined; | ||
}, { | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
@@ -386,2 +373,3 @@ minSize?: number | undefined; | ||
dir?: string | undefined; | ||
file?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
@@ -397,11 +385,30 @@ format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
version?: boolean | undefined; | ||
external?: string[] | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
moduleTypes?: Record<string, "base64" | "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
dropLabels?: string[] | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
version?: boolean | undefined; | ||
}>; | ||
export type CliOptions = z.infer<typeof cliOptionsSchema>; | ||
export declare const schema: ObjectSchema; |
import { Plugin } from '../plugin'; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "augmentChunkHash", "buildEnd", "onLog", "resolveDynamicImport", "generateBundle", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange", "closeWatcher"]; | ||
export declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange"]; | ||
export declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"]; | ||
export declare const ENUMERATED_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange", "augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle", "footer", "banner", "intro", "outro"]; | ||
/** | ||
@@ -4,0 +6,0 @@ * Names of all properties in a `Plugin` object. Includes `name` and `api`. |
@@ -6,2 +6,5 @@ export { defineParallelPlugin } from './plugin/parallel-plugin'; | ||
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, } from './plugin/builtin-plugin'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, } from './builtin-plugin/constructors'; | ||
export { transformPlugin } from './builtin-plugin/transform-plugin'; | ||
export { replacePlugin } from './builtin-plugin/replace-plugin'; | ||
export { aliasPlugin } from './builtin-plugin/alias-plugin'; |
@@ -1,4 +0,4 @@ | ||
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './types/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './types/output-options'; | ||
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, RolldownRenderedChunk, SourceMap } from './types/rolldown-output'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './options/output-options'; | ||
import type { RolldownOptions } from './types/rolldown-options'; | ||
@@ -14,14 +14,15 @@ import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import { InternalModuleFormat, NormalizedOutputOptions } from './options/normalized-output-options'; | ||
import { RenderedChunk, PreRenderedChunk } from './binding'; | ||
import { PreRenderedChunk } from './binding'; | ||
import { PartialNull } from './types/utils'; | ||
import { NormalizedInputOptions } from './options/normalized-input-options'; | ||
import { ModuleInfo } from './types/module-info'; | ||
import { MinimalPluginContext } from './log/logger'; | ||
import { MinimalPluginContext } from './plugin/minimal-plugin-context'; | ||
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap'; | ||
import { OutputBundle } from './types/output-bundle'; | ||
import { WatchOptions } from './options/watch-option'; | ||
import { WatchOptions } from './options/watch-options'; | ||
import { Watcher } from './watcher'; | ||
export { defineConfig, rolldown, watch }; | ||
export declare const VERSION: string; | ||
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, }; | ||
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, Watcher, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './rollup'; |
@@ -1,20 +0,6 @@ | ||
import type { LoggingFunction, LogHandler, RollupError } from '../rollup'; | ||
import type { LogHandler } from '../rollup'; | ||
import type { Plugin } from '../plugin'; | ||
import { type LogLevelOption } from './logging'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
export interface PluginContextMeta { | ||
rollupVersion: string; | ||
rolldownVersion: string; | ||
watchMode: boolean; | ||
} | ||
export declare class MinimalPluginContext { | ||
debug: LoggingFunction; | ||
info: LoggingFunction; | ||
meta: PluginContextMeta; | ||
warn: LoggingFunction; | ||
readonly error: (error: RollupError | string) => never; | ||
constructor(options: NormalizedInputOptions, plugin: Plugin); | ||
} | ||
import type { InputOptions } from '../options/input-options'; | ||
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"]; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler; |
import type { RollupLog } from '../rollup'; | ||
export declare function logInvalidLogPosition(pluginName: string): RollupLog; | ||
export declare function logInputHookInOutputPlugin(pluginName: string, hookName: string): RollupLog; | ||
export declare function logCycleLoading(pluginName: string, moduleId: string): RollupLog; | ||
export declare function logPluginError(error: Omit<RollupLog, 'code'> & { | ||
@@ -4,0 +6,0 @@ code?: unknown; |
@@ -1,580 +0,102 @@ | ||
import { z } from 'zod'; | ||
import type { RolldownPluginRec } from '../plugin'; | ||
export declare const inputOptionsSchema: z.ZodObject<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
treeshake?: boolean | z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
import { RolldownPluginOption } from '../plugin'; | ||
import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging'; | ||
import { TreeshakingOptions } from '../treeshake'; | ||
import { NullValue, StringOrRegExp } from '../types/utils'; | ||
export type InputOption = string | string[] | Record<string, string>; | ||
export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>); | ||
export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>; | ||
export interface JsxOptions { | ||
mode?: 'classic' | 'automatic'; | ||
factory?: string; | ||
fragment?: string; | ||
importSource?: string; | ||
jsxImportSource?: string; | ||
refresh?: boolean; | ||
development?: boolean; | ||
} | ||
export interface WatchOptions { | ||
skipWrite?: boolean; | ||
notify?: { | ||
pollInterval?: number; | ||
compareContents?: boolean; | ||
}; | ||
include?: StringOrRegExp | StringOrRegExp[]; | ||
exclude?: StringOrRegExp | StringOrRegExp[]; | ||
chokidar?: any; | ||
} | ||
export interface InputOptions { | ||
input?: InputOption; | ||
plugins?: RolldownPluginOption; | ||
external?: ExternalOption; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
alias?: Record<string, string>; | ||
aliasFields?: string[][]; | ||
conditionNames?: string[]; | ||
extensionAlias?: Record<string, string[]>; | ||
exportsFields?: string[][]; | ||
extensions?: string[]; | ||
mainFields?: string[]; | ||
mainFiles?: string[]; | ||
modules?: string[]; | ||
symlinks?: boolean; | ||
tsconfigFilename?: string; | ||
}; | ||
cwd?: string; | ||
/** | ||
* Expected platform where the code run. | ||
* | ||
* @default | ||
* - 'node' if the format is 'cjs' | ||
* - 'browser' for other formats | ||
*/ | ||
platform?: 'node' | 'browser' | 'neutral'; | ||
shimMissingExports?: boolean; | ||
treeshake?: boolean | TreeshakingOptions; | ||
logLevel?: LogLevelOption; | ||
onLog?: (level: LogLevel, log: RollupLog, defaultHandler: (level: LogLevelWithError, log: RollupLogWithString) => void) => void; | ||
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void; | ||
moduleTypes?: ModuleTypes; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
treeshake?: boolean | z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">, "strict", z.ZodTypeAny, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
enableComposingJsPlugins?: boolean; | ||
strictExecutionOrder?: boolean; | ||
disableLiveBindings?: boolean; | ||
viteMode?: boolean; | ||
resolveNewUrlToAsset?: boolean; | ||
}; | ||
define?: Record<string, string>; | ||
/** | ||
* Inject import statements on demand. | ||
* | ||
* ## Supported patterns | ||
* ```js | ||
* { | ||
* // import { Promise } from 'es6-promise' | ||
* Promise: ['es6-promise', 'Promise'], | ||
* | ||
* // import { Promise as P } from 'es6-promise' | ||
* P: ['es6-promise', 'Promise'], | ||
* | ||
* // import $ from 'jquery' | ||
* $: 'jquery', | ||
* | ||
* // import * as fs from 'node:fs' | ||
* fs: ['node:fs', '*'], | ||
* | ||
* // Inject shims for property access pattern | ||
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ), | ||
* } | ||
* ``` | ||
*/ | ||
inject?: Record<string, string | [string, string]>; | ||
profilerNames?: boolean; | ||
jsx?: JsxOptions; | ||
watch?: WatchOptions | false; | ||
dropLabels?: string[]; | ||
} | ||
interface OverwriteInputOptionsForCli { | ||
external?: string[]; | ||
inject?: Record<string, string>; | ||
treeshake?: boolean; | ||
} | ||
export type InputCliOptions = Omit<InputOptions, keyof OverwriteInputOptionsForCli | 'input' | 'plugins' | 'onwarn' | 'onLog' | 'resolve' | 'experimental' | 'profilerNames' | 'watch'> & OverwriteInputOptionsForCli; | ||
export {}; |
@@ -1,12 +0,18 @@ | ||
import type { LogLevelOption, RollupLog, NormalizedInputOptions as RollupNormalizedInputOptions } from '../rollup'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { LogLevel } from '../log/logging'; | ||
import { NormalizedTreeshakingOptions } from '../treeshake'; | ||
export interface NormalizedInputOptions extends Omit<InputOptions, 'treeshake'> { | ||
input: RollupNormalizedInputOptions['input']; | ||
plugins: RolldownPlugin[]; | ||
onLog: (level: LogLevel, log: RollupLog) => void; | ||
logLevel: LogLevelOption; | ||
treeshake?: NormalizedTreeshakingOptions; | ||
import type { LogHandler } from '../rollup'; | ||
import { BindingNormalizedOptions } from '../binding'; | ||
import { InputOptions } from '..'; | ||
export interface NormalizedInputOptions { | ||
input: string[] | Record<string, string>; | ||
cwd: string | undefined; | ||
platform: InputOptions['platform']; | ||
shimMissingExports: boolean; | ||
} | ||
export declare class NormalizedInputOptionsImpl implements NormalizedInputOptions { | ||
onLog: LogHandler; | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions, onLog: LogHandler); | ||
get shimMissingExports(): boolean; | ||
get input(): string[] | Record<string, string>; | ||
get cwd(): string | undefined; | ||
get platform(): "node" | "browser" | "neutral"; | ||
} |
@@ -1,18 +0,63 @@ | ||
import type { SourcemapIgnoreListOption } from '../rollup'; | ||
import type { AddonFunction, OutputOptions } from '../types/output-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd'; | ||
export interface NormalizedOutputOptions extends OutputOptions { | ||
plugins: RolldownPlugin[]; | ||
import type { BindingNormalizedOptions } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import type { ChunkFileNamesFunction, GlobalsFunction, OutputOptions } from './output-options'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd' | 'app'; | ||
export interface NormalizedOutputOptions { | ||
name: string | undefined; | ||
file: string | undefined; | ||
dir: string | undefined; | ||
entryFileNames: string | ChunkFileNamesFunction; | ||
chunkFileNames: string | ChunkFileNamesFunction; | ||
assetFileNames: string; | ||
format: InternalModuleFormat; | ||
exports: 'auto' | 'named' | 'default' | 'none'; | ||
exports: NonNullable<OutputOptions['exports']>; | ||
sourcemap: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption; | ||
banner: AddonFunction; | ||
footer: AddonFunction; | ||
intro: AddonFunction; | ||
outro: AddonFunction; | ||
cssEntryFileNames: string | ChunkFileNamesFunction; | ||
cssChunkFileNames: string | ChunkFileNamesFunction; | ||
inlineDynamicImports: boolean; | ||
externalLiveBindings: boolean; | ||
banner: OutputOptions['banner']; | ||
footer: OutputOptions['footer']; | ||
intro: OutputOptions['intro']; | ||
outro: OutputOptions['outro']; | ||
esModule: boolean | 'if-default-prop'; | ||
assetFileNames: string; | ||
inlineDynamicImports: boolean; | ||
extend: boolean; | ||
globals: Record<string, string> | GlobalsFunction; | ||
hashCharacters: 'base64' | 'base36' | 'hex'; | ||
sourcemapDebugIds: boolean; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption | undefined; | ||
sourcemapPathTransform: SourcemapPathTransformOption | undefined; | ||
minify: boolean; | ||
comments: 'none' | 'preserve-legal'; | ||
} | ||
export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions { | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions); | ||
get dir(): string | undefined; | ||
get entryFileNames(): string | (() => never); | ||
get chunkFileNames(): string | (() => never); | ||
get assetFileNames(): string; | ||
get format(): "es" | "cjs" | "iife" | "umd" | "app"; | ||
get exports(): "auto" | "named" | "default" | "none"; | ||
get sourcemap(): boolean | "inline" | "hidden"; | ||
get cssEntryFileNames(): string | (() => never); | ||
get cssChunkFileNames(): string | (() => never); | ||
get shimMissingExports(): boolean; | ||
get name(): string | undefined; | ||
get file(): string | undefined; | ||
get inlineDynamicImports(): boolean; | ||
get externalLiveBindings(): boolean; | ||
get banner(): string | (() => never) | undefined; | ||
get footer(): string | (() => never) | undefined; | ||
get intro(): string | (() => never) | undefined; | ||
get outro(): string | (() => never) | undefined; | ||
get esModule(): boolean | "if-default-prop"; | ||
get extend(): boolean; | ||
get globals(): Record<string, string> | (() => never); | ||
get hashCharacters(): "base64" | "base36" | "hex"; | ||
get sourcemapDebugIds(): boolean; | ||
get sourcemapIgnoreList(): (() => never) | undefined; | ||
get sourcemapPathTransform(): (() => never) | undefined; | ||
get minify(): boolean; | ||
get comments(): "none" | "preserve-legal"; | ||
} |
@@ -1,145 +0,77 @@ | ||
import { z } from 'zod'; | ||
import type { RenderedChunk, PreRenderedChunk } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
hashCharacters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"base64">, z.ZodLiteral<"base36">]>, z.ZodLiteral<"hex">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<SourcemapPathTransformOption, z.ZodTypeDef, SourcemapPathTransformOption>>; | ||
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
import type { StringOrRegExp } from '../types/utils'; | ||
import type { PreRenderedChunk } from '../binding'; | ||
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import { RolldownOutputPluginOption } from '../plugin'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd' | 'experimental-app'; | ||
export type AddonFunction = (chunk: RolldownRenderedChunk) => string | Promise<string>; | ||
export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string; | ||
export type GlobalsFunction = (name: string) => string; | ||
export interface OutputOptions { | ||
dir?: string; | ||
file?: string; | ||
exports?: 'auto' | 'named' | 'default' | 'none'; | ||
hashCharacters?: 'base64' | 'base36' | 'hex'; | ||
/** | ||
* Expected format of generated code. | ||
* - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module. | ||
* - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module. | ||
* - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE). | ||
* - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd). | ||
* | ||
* @default 'esm' | ||
*/ | ||
format?: ModuleFormat; | ||
sourcemap?: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption; | ||
sourcemapPathTransform?: SourcemapPathTransformOption; | ||
banner?: string | AddonFunction; | ||
footer?: string | AddonFunction; | ||
intro?: string | AddonFunction; | ||
outro?: string | AddonFunction; | ||
extend?: boolean; | ||
esModule?: boolean | 'if-default-prop'; | ||
assetFileNames?: string; | ||
entryFileNames?: string | ChunkFileNamesFunction; | ||
chunkFileNames?: string | ChunkFileNamesFunction; | ||
cssEntryFileNames?: string | ChunkFileNamesFunction; | ||
cssChunkFileNames?: string | ChunkFileNamesFunction; | ||
minify?: boolean; | ||
name?: string; | ||
globals?: Record<string, string> | GlobalsFunction; | ||
externalLiveBindings?: boolean; | ||
inlineDynamicImports?: boolean; | ||
advancedChunks?: { | ||
minSize?: number; | ||
minShareCount?: number; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>; | ||
}, { | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}>>; | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">, "strict", z.ZodTypeAny, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
test?: StringOrRegExp; | ||
priority?: number; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}[]; | ||
}; | ||
/** | ||
* Control comments in the output. | ||
* | ||
* - `none`: no comments | ||
* - `preserve-legal`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!` | ||
*/ | ||
comments?: 'none' | 'preserve-legal'; | ||
plugins?: RolldownOutputPluginOption; | ||
} | ||
interface OverwriteOutputOptionsForCli { | ||
banner?: string; | ||
footer?: string; | ||
intro?: string; | ||
outro?: string; | ||
esModule?: boolean; | ||
globals?: Record<string, string>; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}>; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}; | ||
} | ||
export type OutputCliOptions = Omit<OutputOptions, keyof OverwriteOutputOptionsForCli | 'sourcemapIgnoreList' | 'sourcemapPathTransform'> & OverwriteOutputOptionsForCli; | ||
export {}; |
@@ -1,12 +0,10 @@ | ||
import type { BindingPluginOptions } from '../binding'; | ||
import type { hookFilterExtension, Plugin } from './index'; | ||
import { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import type { BindingGeneralHookFilter, BindingPluginOptions, BindingTransformHookFilter } from '../binding'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyBuildStart(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['buildStart']>; | ||
export declare function bindingifyBuildEnd(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['buildEnd']>; | ||
export declare function bindingifyResolveId(plugin: Plugin, normalizedOptions: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['resolveId'], hookFilterExtension<'transform'>>; | ||
export declare function bindingifyResolveDynamicImport(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['resolveDynamicImport']>; | ||
export declare function bindingifyTransform(plugin: Plugin, normalizedOptions: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['transform']>; | ||
export declare function bindingifyLoad(plugin: Plugin, normalized_options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['load']>; | ||
export declare function bindingifyModuleParsed(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['moduleParsed']>; | ||
import type { BindingifyPluginArgs } from './bindingify-plugin'; | ||
export declare function bindingifyBuildStart(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['buildStart']>; | ||
export declare function bindingifyBuildEnd(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['buildEnd']>; | ||
export declare function bindingifyResolveId(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['resolveId'], BindingGeneralHookFilter | undefined>; | ||
export declare function bindingifyResolveDynamicImport(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['resolveDynamicImport']>; | ||
export declare function bindingifyTransform(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['transform'], BindingTransformHookFilter | undefined>; | ||
export declare function bindingifyLoad(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['load'], BindingGeneralHookFilter | undefined>; | ||
export declare function bindingifyModuleParsed(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['moduleParsed']>; |
@@ -1,7 +0,7 @@ | ||
import { BindingGeneralHookFilter, BindingTransformHookFilter } from '../binding.d'; | ||
import { hookFilterExtension } from '.'; | ||
import type { StringFilter } from './hook-filter'; | ||
import type { HookFilterExtension } from '.'; | ||
import type { BindingGeneralHookFilter, BindingTransformHookFilter } from '../binding.d'; | ||
export declare function bindingifyStringFilter(matcher: StringFilter): BindingGeneralHookFilter; | ||
export declare function bindingifyResolveIdFilter(filterOption?: hookFilterExtension<'resolveId'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyLoadFilter(filterOption?: hookFilterExtension<'load'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyTransformFilter(filterOption?: hookFilterExtension<'transform'>['filter']): BindingTransformHookFilter | undefined; | ||
export declare function bindingifyResolveIdFilter(filterOption?: HookFilterExtension<'resolveId'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyLoadFilter(filterOption?: HookFilterExtension<'load'>['filter']): BindingGeneralHookFilter | undefined; | ||
export declare function bindingifyTransformFilter(filterOption?: HookFilterExtension<'transform'>['filter']): BindingTransformHookFilter | undefined; |
@@ -0,17 +1,14 @@ | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
import type { BindingifyPluginArgs } from './bindingify-plugin'; | ||
import type { BindingPluginOptions } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { Plugin } from './index'; | ||
import { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyRenderStart(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderStart']>; | ||
export declare function bindingifyRenderChunk(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderChunk']>; | ||
export declare function bindingifyAugmentChunkHash(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['augmentChunkHash']>; | ||
export declare function bindingifyRenderError(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['renderError']>; | ||
export declare function bindingifyGenerateBundle(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['generateBundle']>; | ||
export declare function bindingifyWriteBundle(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['writeBundle']>; | ||
export declare function bindingifyCloseBundle(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['closeBundle']>; | ||
export declare function bindingifyBanner(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['banner']>; | ||
export declare function bindingifyFooter(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['footer']>; | ||
export declare function bindingifyIntro(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['intro']>; | ||
export declare function bindingifyOutro(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['outro']>; | ||
export declare function bindingifyRenderStart(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderStart']>; | ||
export declare function bindingifyRenderChunk(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderChunk']>; | ||
export declare function bindingifyAugmentChunkHash(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['augmentChunkHash']>; | ||
export declare function bindingifyRenderError(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['renderError']>; | ||
export declare function bindingifyGenerateBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['generateBundle']>; | ||
export declare function bindingifyWriteBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['writeBundle']>; | ||
export declare function bindingifyCloseBundle(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['closeBundle']>; | ||
export declare function bindingifyBanner(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['banner']>; | ||
export declare function bindingifyFooter(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['footer']>; | ||
export declare function bindingifyIntro(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['intro']>; | ||
export declare function bindingifyOutro(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['outro']>; |
import type { BindingPluginOptions } from '../binding'; | ||
import type { Plugin } from './index'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
export declare function bindingifyPlugin(plugin: Plugin, options: NormalizedInputOptions, outputOptions: NormalizedOutputOptions, pluginContextData: PluginContextData): BindingPluginOptions; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
import type { InputOptions } from '../options/input-options'; | ||
export interface BindingifyPluginArgs { | ||
plugin: Plugin; | ||
options: InputOptions; | ||
outputOptions: OutputOptions; | ||
pluginContextData: PluginContextData; | ||
onLog: LogHandler; | ||
logLevel: LogLevelOption; | ||
} | ||
export declare function bindingifyPlugin(plugin: Plugin, options: InputOptions, outputOptions: OutputOptions, pluginContextData: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption): BindingPluginOptions; |
import type { BindingPluginOptions } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { Plugin } from './index'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { PluginHookWithBindingExt } from './bindingify-plugin-hook-meta'; | ||
export declare function bindingifyWatchChange(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['watchChange']>; | ||
export declare function bindingifyCloseWatcher(plugin: Plugin, options: NormalizedInputOptions, pluginContextData: PluginContextData): PluginHookWithBindingExt<BindingPluginOptions['closeWatcher']>; | ||
import { BindingifyPluginArgs } from './bindingify-plugin'; | ||
export declare function bindingifyWatchChange(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['watchChange']>; | ||
export declare function bindingifyCloseWatcher(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['closeWatcher']>; |
@@ -1,2 +0,2 @@ | ||
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs, RenderedChunk } from '../binding'; | ||
import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
@@ -7,3 +7,3 @@ import type { NullValue, MaybePromise, PartialNull, MakeAsync } from '../types/utils'; | ||
import type { OutputBundle } from '../types/output-bundle'; | ||
import { PluginContext } from './plugin-context'; | ||
import type { PluginContext } from './plugin-context'; | ||
import type { TransformPluginContext } from './transform-plugin-context'; | ||
@@ -13,10 +13,11 @@ import type { NormalizedOutputOptions } from '../options/normalized-output-options'; | ||
import type { RollupLog } from '../rollup'; | ||
import type { MinimalPluginContext } from '../log/logger'; | ||
import { InputOptions, OutputOptions } from '..'; | ||
import { BuiltinPlugin } from './builtin-plugin'; | ||
import { ParallelPlugin } from './parallel-plugin'; | ||
import type { MinimalPluginContext } from './minimal-plugin-context'; | ||
import type { InputOptions, OutputOptions } from '..'; | ||
import type { BuiltinPlugin } from '../builtin-plugin/constructors'; | ||
import type { ParallelPlugin } from './parallel-plugin'; | ||
import type { DefinedHookNames } from '../constants/plugin'; | ||
import { DEFINED_HOOK_NAMES } from '../constants/plugin'; | ||
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import { HookFilter } from './hook-filter'; | ||
import type { DEFINED_HOOK_NAMES } from '../constants/plugin'; | ||
import type { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import type { HookFilter } from './hook-filter'; | ||
import { RolldownRenderedChunk } from '../types/rolldown-output'; | ||
export type ModuleSideEffects = boolean | 'no-treeshake' | null; | ||
@@ -74,7 +75,7 @@ export type ModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {}); | ||
[DEFINED_HOOK_NAMES.renderStart]: (this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void; | ||
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RolldownRenderedChunk, outputOptions: NormalizedOutputOptions) => NullValue | string | { | ||
code: string; | ||
map?: SourceMapInput; | ||
}; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RolldownRenderedChunk) => string | void; | ||
[DEFINED_HOOK_NAMES.renderError]: (this: PluginContext, error: Error) => void; | ||
@@ -91,8 +92,8 @@ [DEFINED_HOOK_NAMES.generateBundle]: (this: PluginContext, outputOptions: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void; | ||
export type PluginOrder = 'pre' | 'post' | null; | ||
export type ObjectHookMeta<O = {}> = { | ||
export type ObjectHookMeta = { | ||
order?: PluginOrder; | ||
} & O; | ||
}; | ||
export type ObjectHook<T, O = {}> = T | ({ | ||
handler: T; | ||
} & ObjectHookMeta<O>); | ||
} & ObjectHookMeta & O); | ||
export type SyncPluginHooks = DefinedHookNames['augmentChunkHash' | 'onLog' | 'outputOptions']; | ||
@@ -105,3 +106,3 @@ export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>; | ||
export type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>; | ||
export type hookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? { | ||
export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform' ? { | ||
filter?: HookFilter; | ||
@@ -112,5 +113,5 @@ } : K extends 'load' | 'resolveId' ? { | ||
export type PluginHooks = { | ||
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], hookFilterExtension<K>>; | ||
[K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K>>; | ||
}; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>; | ||
export type AddonHookFunction = (this: PluginContext, chunk: RolldownRenderedChunk) => string | Promise<string>; | ||
export type AddonHook = string | AddonHookFunction; | ||
@@ -128,4 +129,5 @@ export interface OutputPlugin extends Partial<{ | ||
export type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin; | ||
export type RolldownPluginOption<A = any> = NullValue<RolldownPlugin<A>> | false; | ||
export type RolldownPluginRec<A = any> = RolldownPluginOption<A> | RolldownPluginOption<A>[]; | ||
export type RolldownPluginOption<A = any> = MaybePromise<NullValue<RolldownPlugin<A>> | false | RolldownPluginOption[]>; | ||
export type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin; | ||
export type RolldownOutputPluginOption = MaybePromise<NullValue<RolldownOutputPlugin> | false | RolldownOutputPluginOption[]>; | ||
export {}; |
@@ -7,4 +7,5 @@ import { BindingPluginContext } from '../binding'; | ||
resolveOptionsMap: Map<number, PluginContextResolveOptions>; | ||
loadModulePromiseMap: Map<string, Promise<void>>; | ||
updateModuleOption(id: string, option: ModuleOptions): void; | ||
getModuleOption(id: string): ModuleOptions | undefined; | ||
getModuleOption(id: string): ModuleOptions; | ||
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null; | ||
@@ -11,0 +12,0 @@ getModuleIds(context: BindingPluginContext): ArrayIterator<string>; |
import type { BindingPluginContext } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { CustomPluginOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../log/logger'; | ||
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../plugin/minimal-plugin-context'; | ||
import { AssetSource } from '../utils/asset-source'; | ||
@@ -9,2 +8,4 @@ import { ModuleInfo } from '../types/module-info'; | ||
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context'; | ||
import { PartialNull } from '../types/utils'; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
export interface EmittedAsset { | ||
@@ -26,2 +27,6 @@ type: 'asset'; | ||
export declare class PluginContext extends MinimalPluginContext { | ||
readonly load: (options: { | ||
id: string; | ||
resolveDependencies?: boolean; | ||
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>; | ||
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>; | ||
@@ -37,3 +42,3 @@ readonly emitFile: (file: EmittedAsset) => string; | ||
readonly parse: (input: string, options?: any) => any; | ||
constructor(options: NormalizedInputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData); | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, onLog: LogHandler, logLevel: LogLevelOption, currentLoadingModule?: string); | ||
} |
@@ -1,9 +0,8 @@ | ||
import { Plugin, RolldownPluginRec } from './'; | ||
import { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import { InputOptions, OutputOptions } from '..'; | ||
import { Plugin } from './'; | ||
import { InputOptions, OutputOptions, RolldownPlugin } from '..'; | ||
export declare class PluginDriver { | ||
callOptionsHook(inputOptions: InputOptions): Promise<InputOptions>; | ||
callOutputOptionsHook(inputOptions: NormalizedInputOptions, outputOptions: OutputOptions): OutputOptions; | ||
callOutputOptionsHook(rawPlugins: RolldownPlugin[], outputOptions: OutputOptions): OutputOptions; | ||
} | ||
export declare function getObjectPlugins(plugins: RolldownPluginRec[]): Plugin[]; | ||
export declare function getObjectPlugins(plugins: RolldownPlugin[]): Plugin[]; | ||
export declare function getSortedPlugins(hookName: 'options' | 'outputOptions' | 'onLog', plugins: readonly Plugin[]): Plugin[]; |
import type { BindingPluginContext, BindingTransformPluginContext } from '../binding'; | ||
import type { RollupError } from '../rollup'; | ||
import type { LogHandler, LogLevelOption, RollupError } from '../rollup'; | ||
import { PluginContext } from './plugin-context'; | ||
import { PluginContextData } from './plugin-context-data'; | ||
import { NormalizedInputOptions } from '..'; | ||
import type { Plugin } from './index'; | ||
import { SourceMap } from '../types/rolldown-output'; | ||
export declare class TransformPluginContext extends PluginContext { | ||
@@ -12,3 +12,4 @@ error: (error: RollupError | string, pos?: number | { | ||
}) => never; | ||
constructor(options: NormalizedInputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string); | ||
getCombinedSourcemap: () => SourceMap; | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption); | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { InputOptions } from './types/input-options'; | ||
import type { OutputOptions } from './types/output-options'; | ||
import type { InputOptions } from './options/input-options'; | ||
import type { OutputOptions } from './options/output-options'; | ||
import type { RolldownOutput } from './types/rolldown-output'; | ||
@@ -7,5 +7,7 @@ export declare class RolldownBuild { | ||
constructor(inputOptions: InputOptions); | ||
get closed(): boolean; | ||
generate(outputOptions?: OutputOptions): Promise<RolldownOutput>; | ||
write(outputOptions?: OutputOptions): Promise<RolldownOutput>; | ||
close(): Promise<void>; | ||
[Symbol.asyncDispose](): Promise<void>; | ||
} |
@@ -1,5 +0,5 @@ | ||
import type { InputOptions } from './types/input-options'; | ||
import type { InputOptions } from './options/input-options'; | ||
import { RolldownBuild } from './rolldown-build'; | ||
import { Watcher } from './watcher'; | ||
import { WatchOptions } from './options/watch-option'; | ||
import { WatchOptions } from './options/watch-options'; | ||
export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>; | ||
@@ -6,0 +6,0 @@ export declare const watch: (input: WatchOptions) => Promise<Watcher>; |
@@ -1,1 +0,1 @@ | ||
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, } from './rollup'; | ||
export type { OutputOptions, InputOptions, Plugin, OutputPlugin, OutputChunk, NormalizedInputOptions, OutputAsset, OutputBundle, SourceMapInput, RenderedChunk, } from './rollup'; |
@@ -1,5 +0,1 @@ | ||
import { ModuleSideEffectsRule } from './module-side-effects'; | ||
export interface NormalizedTreeshakingOptions { | ||
moduleSideEffects: boolean | ModuleSideEffectsRule[]; | ||
} | ||
export * from './module-side-effects'; |
@@ -9,18 +9,17 @@ import { z } from 'zod'; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>; | ||
export type ModuleSideEffectsRule = z.infer<typeof ModuleSideEffectsRuleSchema>; | ||
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
@@ -32,16 +31,16 @@ test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>; | ||
@@ -55,17 +54,18 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
@@ -78,17 +78,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
@@ -101,18 +102,19 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>; | ||
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>; |
@@ -1,5 +0,5 @@ | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export interface RolldownOptions extends InputOptions { | ||
output?: OutputOptions; | ||
} |
import { AssetSource } from '../utils/asset-source'; | ||
import type { RenderedModule } from './rendered-module'; | ||
import type { RenderedChunk } from '../binding'; | ||
export interface RolldownOutputAsset { | ||
@@ -18,2 +18,11 @@ type: 'asset'; | ||
} | ||
export interface RolldownRenderedModule { | ||
readonly code: string | null; | ||
renderedLength: number; | ||
} | ||
export interface RolldownRenderedChunk extends Omit<RenderedChunk, 'modules'> { | ||
modules: { | ||
[id: string]: RolldownRenderedModule; | ||
}; | ||
} | ||
export interface RolldownOutputChunk { | ||
@@ -27,3 +36,3 @@ type: 'chunk'; | ||
modules: { | ||
[id: string]: RenderedModule; | ||
[id: string]: RolldownRenderedModule; | ||
}; | ||
@@ -30,0 +39,0 @@ imports: string[]; |
import { Bundler } from '../binding'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export declare function createBundler(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<BundlerWithStopWorker>; | ||
@@ -5,0 +5,0 @@ export interface BundlerWithStopWorker { |
import { AnyFn } from '../types/utils'; | ||
import type { ObjectHook, ObjectHookMeta } from '../plugin'; | ||
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? { | ||
export declare function normalizeHook<Hook extends ObjectHook<AnyFn | string>>(hook: Hook): Hook extends ObjectHook<infer RawHook, infer CustomOptions> ? Hook extends RawHook ? never : { | ||
handler: RawHook; | ||
@@ -5,0 +5,0 @@ options: CustomOptions; |
@@ -1,8 +0,13 @@ | ||
import type { OutputOptions, OutputPlugin } from '../rollup-types'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
import { LogHandler } from '../rollup'; | ||
export declare const normalizePluginOption: { | ||
(plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<RolldownOutputPlugin[]>; | ||
(plugins: unknown): Promise<any[]>; | ||
}; | ||
export declare function checkOutputPluginOption(plugins: RolldownOutputPlugin[], onLog: LogHandler): RolldownOutputPlugin[]; | ||
export declare function normalizePlugins<T extends RolldownPlugin>(plugins: T[], anonymousPrefix: string): T[]; | ||
export declare const ANONYMOUS_PLUGIN_PREFIX = "at position "; | ||
export declare const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position "; |
@@ -1,2 +0,2 @@ | ||
import { BindingStringOrRegex } from '../binding.d'; | ||
import type { BindingStringOrRegex } from '../binding'; | ||
export declare function normalizedStringOrRegex(pattern?: Array<string | RegExp> | (string | RegExp)): BindingStringOrRegex[] | undefined; |
@@ -0,1 +1,3 @@ | ||
import { ExistingRawSourceMap, SourceMapInput } from '../types/sourcemap'; | ||
export declare function isEmptySourcemapFiled(array: undefined | (string | null)[]): boolean; | ||
export declare function normalizeTransformHookSourcemap(id: string, originalCode: string, rawMap?: SourceMapInput): ExistingRawSourceMap | undefined; |
@@ -5,2 +5,3 @@ import type { RolldownOutput } from '../types/rolldown-output'; | ||
export declare function transformToRollupOutput(output: BindingOutputs, changed?: ChangedOutputs): RolldownOutput; | ||
export declare function handleOutputErrors(output: BindingOutputs): void; | ||
export declare function transformToOutputBundle(output: BindingOutputs, changed: ChangedOutputs): OutputBundle; | ||
@@ -7,0 +8,0 @@ export interface ChangedOutputs { |
@@ -8,2 +8,3 @@ import { BindingWatcher } from './binding'; | ||
stopWorkers?: () => Promise<void>; | ||
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>; | ||
constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>); | ||
@@ -31,3 +32,4 @@ close(): Promise<void>; | ||
} | { | ||
code: 'ERROR'; /** error: RollupError; result: RollupBuild | null **/ | ||
code: 'ERROR'; | ||
error: Error; | ||
}; |
{ | ||
"name": "rolldown", | ||
"version": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"version": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -84,9 +84,18 @@ "homepage": "https://rolldown.rs/", | ||
}, | ||
"peerDependencies": { | ||
"@babel/runtime": ">=7" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@babel/runtime": { | ||
"optional": true | ||
} | ||
}, | ||
"devDependencies": { | ||
"@jridgewell/sourcemap-codec": "^1.5.0", | ||
"@napi-rs/cli": "^3.0.0-alpha.60", | ||
"@napi-rs/wasm-runtime": "^0.2.4", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/lodash-es": "^4.17.12", | ||
"colorette": "^2.0.20", | ||
"consola": "^3.2.3", | ||
"cross-env": "^7.0.3", | ||
"emnapi": "^1.2.0", | ||
@@ -101,25 +110,24 @@ "execa": "^9.2.0", | ||
"signal-exit": "4.1.0", | ||
"source-map": "^0.7.4", | ||
"tsx": "^4.19.2", | ||
"type-fest": "^4.20.0", | ||
"unbuild": "^2.0.0", | ||
"vite": "^5.2.13", | ||
"vitest": "^2.0.0", | ||
"why-is-node-running": "^3.0.0", | ||
"zod-to-json-schema": "^3.23.2", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "0.14.0-snapshot-d18e8cb-20241112003342" | ||
"rolldown": "0.14.0-snapshot-d42ea8a-20241202003632" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d18e8cb-20241112003342", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d18e8cb-20241112003342" | ||
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d42ea8a-20241202003632" | ||
}, | ||
@@ -135,3 +143,3 @@ "scripts": { | ||
"bak_build-node": "unbuild", | ||
"build-node": "node ../../node_modules/npm-rolldown/bin/cli.js -c ./rolldown.config.mjs", | ||
"build-node": "tsx ./build.ts", | ||
"build-types": "tsc -p ./tsconfig.dts.json", | ||
@@ -141,6 +149,6 @@ "build-types-check": "tsc -p ./tsconfig.check.json", | ||
"build-native:release": "run-s build-binding:release build-types build-node build-types-check", | ||
"build-wasi:debug": "run-s build-binding:wasi build-node", | ||
"build-wasi:release": "run-s build-binding:wasi:release build-node", | ||
"build-wasi:debug": "run-s build-binding build-binding:wasi build-node", | ||
"build-wasi:release": "run-s build-binding build-binding:wasi:release build-node", | ||
"# Scrips for checking #": "_", | ||
"test": "cross-env RUST_BACKTRACE=1 ROLLDOWN_TEST=1 vitest run --reporter verbose --hideSkippedTests", | ||
"test": "pnpm run --filter rolldown-tests go", | ||
"test:update": "vitest run -u", | ||
@@ -147,0 +155,0 @@ "type-check": "tsc" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
712964
25
14
17307
2