Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rolldown

Package Overview
Dependencies
Maintainers
0
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rolldown - npm Package Compare versions

Comparing version 0.14.0 to 0.15.0-snapshot-22747a3-20241206003640

dist/shared/chunk-BK2Ye-xa.cjs

231

dist/types/binding.d.ts

@@ -6,2 +6,18 @@ 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 BindingHookError {
get errors(): Array<Error | object>
}
export declare class BindingLog {

@@ -22,7 +38,40 @@ 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 {
get fileName(): string
get originalFileName(): string | null
get originalFileNames(): Array<string>
get source(): BindingAssetSource
get name(): string | null
get names(): Array<string>
}

@@ -50,5 +99,7 @@

get assets(): Array<BindingOutputAsset>
get errors(): Array<Error | object>
}
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>

@@ -58,7 +109,12 @@ emitFile(file: BindingEmittedAsset): string

getModuleInfo(moduleId: string): BindingModuleInfo | null
getModuleIds(): Array<string> | null
getModuleIds(): Array<string>
addWatchFile(file: string): void
}
export declare class BindingRenderedModule {
get code(): string | null
}
export declare class BindingTransformPluginContext {
getCombinedSourcemap(): string
inner(): BindingPluginContext

@@ -69,5 +125,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<Error | object>
}
export declare class Bundler {

@@ -77,5 +146,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 +208,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 +233,4 @@ export interface BindingEmittedAsset {

disableLiveBindings?: boolean
viteMode?: boolean
resolveNewUrlToAsset?: boolean
}

@@ -177,2 +248,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 +327,3 @@ code: string

platform?: 'node' | 'browser' | 'neutral'
logLevel?: BindingLogLevel
logLevel: BindingLogLevel
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void

@@ -247,2 +334,3 @@ cwd: string

define?: Array<[string, string]>
dropLabels?: Array<string>
inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace>

@@ -253,2 +341,3 @@ experimental?: BindingExperimentalOptions

watch?: BindingWatchOption
keepNames?: boolean
}

@@ -270,2 +359,6 @@

export interface BindingJsWatchChangeEvent {
event: string
}
export declare enum BindingLogLevel {

@@ -295,2 +388,8 @@ Silent = 0,

export interface BindingModuleSideEffectsRule {
test?: RegExp | undefined
sideEffects: boolean
external?: boolean | undefined
}
export interface BindingNotifyOption {

@@ -303,5 +402,7 @@ pollInterval?: number

name?: string
assetFileNames?: string
entryFileNames?: string | ((chunk: PreRenderedChunk) => string)
chunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
assetFileNames?: string
cssEntryFileNames?: string | ((chunk: PreRenderedChunk) => string)
cssChunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
banner?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>

@@ -315,4 +416,5 @@ dir?: string

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'
inlineDynamicImports?: boolean

@@ -328,2 +430,3 @@ intro?: (chunk: RenderedChunk) => MaybePromise<VoidNullable<string>>

advancedChunks?: BindingAdvancedChunksOptions
comments?: 'none' | 'preserve-legal'
}

@@ -348,3 +451,3 @@

name: string
buildStart?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable>
buildStartMeta?: BindingPluginHookMeta

@@ -364,15 +467,15 @@ resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>

moduleParsedMeta?: BindingPluginHookMeta
buildEnd?: (ctx: BindingPluginContext, error: Nullable<string>) => MaybePromise<VoidNullable>
buildEnd?: (ctx: BindingPluginContext, error?: BindingHookError) => MaybePromise<VoidNullable>
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

@@ -405,6 +508,2 @@ closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>

export interface BindingRenderedModule {
code?: string
}
export interface BindingReplacePluginConfig {

@@ -415,2 +514,3 @@ values: Record<string, string>

objectGuards?: boolean
sourcemap?: boolean
}

@@ -450,16 +550,40 @@

jsxInject?: string
targets?: string
reactRefresh?: boolean
target?: string
browserslist?: string
}
export interface BindingTreeshake {
moduleSideEffects: string
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
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 | Array<string | RegExp>
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 {

@@ -472,2 +596,10 @@ skipWrite?: boolean

export interface CompilerAssumptions {
ignoreFunctionLength?: boolean
noDocumentAll?: boolean
objectRestNoSymbols?: boolean
pureGetters?: boolean
setPublicClassFields?: boolean
}
export interface Es2015Options {

@@ -512,4 +644,4 @@ /** Transform arrow functions into function expressions. */

export interface JsOutputAsset {
name?: string
originalFileName?: string
names: Array<string>
originalFileNames: Array<string>
filename: string

@@ -624,3 +756,3 @@ source: BindingAssetSource

*
* 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}
*

@@ -721,2 +853,4 @@ * @default false

sourcemap?: boolean
/** Set assumptions in order to produce smaller output. */
assumptions?: CompilerAssumptions
/** Configure how TypeScript is transformed. */

@@ -726,2 +860,17 @@ typescript?: TypeScriptOptions

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 */

@@ -728,0 +877,0 @@ define?: Record<string, string>

8

dist/types/cli/arguments/normalize.d.ts

@@ -1,8 +0,4 @@

/**
* @description This file is used for normalize the options.
* In CLI, the input options and output options are mixed together. We need to tell them apart.
*/
import { InputOptions } from '../../options/input-options';
import { OutputOptions } from '../../options/output-options';
import { CliOptions } from './schema';
import type { InputOptions } from '../../options/input-options';
import type { OutputOptions } from '../../options/output-options';
export interface NormalizedCliOptions {

@@ -9,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]>>]>>;

@@ -26,6 +26,7 @@ resolve: z.ZodOptional<z.ZodObject<{

}, "strict", z.ZodTypeAny, {
modules?: string[] | undefined;
alias?: Record<string, string> | undefined;
extensionAlias?: Record<string, string[]> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;

@@ -35,10 +36,10 @@ extensions?: string[] | undefined;

mainFiles?: string[] | undefined;
modules?: 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;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;

@@ -48,3 +49,2 @@ extensions?: string[] | undefined;

mainFiles?: string[] | undefined;
modules?: string[] | undefined;
symlinks?: boolean | undefined;

@@ -56,3 +56,72 @@ tsconfigFilename?: string | undefined;

shimMissingExports: z.ZodOptional<z.ZodBoolean>;
treeshake: z.ZodOptional<z.ZodType<boolean | import("../../treeshake").TreeshakingOptions, z.ZodTypeDef, boolean | import("../../treeshake").TreeshakingOptions>>;
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, 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">]>>;

@@ -66,10 +135,13 @@ 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>>;

disableLiveBindings: z.ZodOptional<z.ZodBoolean>;
resolveNewUrlToAsset: z.ZodOptional<z.ZodBoolean>;
}, "strict", z.ZodTypeAny, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
resolveNewUrlToAsset?: boolean | undefined;
enableComposingJsPlugins?: boolean | undefined;
}, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
resolveNewUrlToAsset?: boolean | undefined;
enableComposingJsPlugins?: boolean | undefined;
}>>;

@@ -88,2 +160,4 @@ define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;

}, "strict", z.ZodTypeAny, {
development?: boolean | undefined;
refresh?: boolean | undefined;
mode?: "classic" | "automatic" | undefined;

@@ -94,5 +168,5 @@ factory?: string | undefined;

jsxImportSource?: string | undefined;
}, {
development?: boolean | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}, {
mode?: "classic" | "automatic" | undefined;

@@ -103,4 +177,2 @@ factory?: string | undefined;

jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}>>;

@@ -123,3 +195,4 @@ watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{

}, "strict", z.ZodTypeAny, {
skipWrite?: boolean | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
notify?: {

@@ -129,7 +202,7 @@ pollInterval?: number | undefined;

} | undefined;
skipWrite?: boolean | undefined;
chokidar?: any;
}, {
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
}, {
skipWrite?: boolean | undefined;
notify?: {

@@ -139,6 +212,6 @@ pollInterval?: number | undefined;

} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
skipWrite?: boolean | undefined;
chokidar?: any;
}>, z.ZodLiteral<false>]>>;
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, {

@@ -148,10 +221,11 @@ external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;

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>;
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<import("../../options/output-options").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../options/output-options").SourcemapIgnoreListOption>]>>;
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../options/output-options").SourcemapPathTransformOption, z.ZodTypeDef, import("../../options/output-options").SourcemapPathTransformOption>>;
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<import("../../rollup").SourcemapIgnoreListOption, z.ZodTypeDef, import("../../rollup").SourcemapIgnoreListOption>]>>;
sourcemapPathTransform: z.ZodOptional<z.ZodType<import("../../rollup").SourcemapPathTransformOption, z.ZodTypeDef, import("../../rollup").SourcemapPathTransformOption>>;
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;

@@ -163,8 +237,10 @@ footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").RenderedChunk, z.ZodTypeDef, import("../..").RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>;

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<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
assetFileNames: z.ZodOptional<z.ZodString>;
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<import("../..").PreRenderedChunk, z.ZodTypeDef, import("../..").PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>;
minify: z.ZodOptional<z.ZodBoolean>;
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>>;

@@ -183,11 +259,11 @@ inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;

name: string;
test?: string | RegExp | undefined;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}, {
name: string;
test?: string | RegExp | undefined;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;

@@ -200,5 +276,5 @@ }>, "many">>;

name: string;
test?: string | RegExp | undefined;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;

@@ -211,8 +287,9 @@ }[] | undefined;

name: string;
test?: string | RegExp | undefined;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
}>>;
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>;
}, {

@@ -224,2 +301,3 @@ banner: z.ZodOptional<z.ZodString>;

esModule: z.ZodOptional<z.ZodBoolean>;
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
advancedChunks: z.ZodOptional<z.ZodObject<{

@@ -236,55 +314,33 @@ minSize: z.ZodOptional<z.ZodNumber>;

}>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, {
external?: string[] | undefined;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | undefined;
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
jsx?: {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
define?: Record<string, string> | undefined;
inject?: Record<string, string> | undefined;
watch?: 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;
esModule?: boolean | undefined;
globals?: Record<string, string> | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
} | undefined;
dir?: string | undefined;
file?: string | undefined;
name?: string | undefined;
exports?: "auto" | "named" | "default" | "none" | 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;
esModule?: boolean | undefined;
assetFileNames?: string | undefined;
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: boolean | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
} | undefined;
version?: boolean | undefined;
config?: string | boolean | undefined;
help?: boolean | undefined;
}, {
comments?: "none" | "preserve-legal" | undefined;
external?: string[] | undefined;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | undefined;
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
jsx?: {
development?: boolean | undefined;
refresh?: boolean | undefined;
mode?: "classic" | "automatic" | undefined;

@@ -295,37 +351,69 @@ factory?: string | undefined;

jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
define?: Record<string, string> | 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;
esModule?: boolean | undefined;
globals?: Record<string, string> | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
} | undefined;
dir?: string | undefined;
file?: string | undefined;
name?: string | undefined;
exports?: "auto" | "named" | "default" | "none" | 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;
esModule?: boolean | undefined;
assetFileNames?: string | undefined;
entryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
cssEntryFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
cssChunkFileNames?: string | ((args_0: import("../..").PreRenderedChunk, ...args: unknown[]) => string) | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: boolean | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
comments?: "none" | "preserve-legal" | 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;
version?: boolean | 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`.

export { defineParallelPlugin } from './plugin/parallel-plugin';
export { experimental_scan as scan } from './rolldown';
export { experimental_scan as scan } from './api/experimental';
export { transform } from './binding';
export type { TransformOptions, TransformResult } from './binding';
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,3 +0,3 @@

import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output';
import type { ExternalOption, InputOption, InputOptions, JsxOptions } from './options/input-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';

@@ -8,20 +8,23 @@ import type { RolldownOptions } from './types/rolldown-options';

import { defineConfig } from './utils/define-config';
import { rolldown, watch } from './rolldown';
import { rolldown } from './api/rolldown';
import { watch } from './api/watch';
import { ConfigExport } from './types/config-export';
import { RolldownBuild } from './rolldown-build';
import { RolldownBuild } from './api/rolldown/rolldown-build';
import { EmittedAsset, EmittedFile, PluginContext } from './plugin/plugin-context';
import { TransformPluginContext } from './plugin/transform-plugin-context';
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';
export { defineConfig, rolldown, watch };
import { WatchOptions } from './options/watch-options';
import { RolldownWatcher } from './api/watch/watch-emitter';
import { build, type BuildOptions } from './api/build';
export { defineConfig, rolldown, watch, build };
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, RolldownWatcher, BuildOptions, };
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, RolldownRenderedChunk as RenderedChunk, RolldownWatcher as RollupWatcher, };
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 '../options/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);
}
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 { z } from 'zod';
export type LogLevel = 'info' | 'debug' | 'warn';
export type LogLevelOption = LogLevel | 'silent';
export type LogLevelWithError = LogLevel | 'error';
export type RollupLog = any;
export type RollupLogWithString = RollupLog | string;
export declare const LogLevelSchema: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>;
export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>;
export declare const LogLevelWithErrorSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>;
export type LogLevel = z.infer<typeof LogLevelSchema>;
export declare const LogLevelOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>;
export type LogLevelOption = z.infer<typeof LogLevelOptionSchema>;
export declare const LOG_LEVEL_SILENT: LogLevelOption;

@@ -8,0 +11,0 @@ export declare const LOG_LEVEL_ERROR = "error";

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,429 +0,67 @@

import type { RolldownPluginRec } from '../plugin';
import { z } from 'zod';
import { RolldownPluginOption } from '../plugin';
import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging';
import { TreeshakingOptions } from '../treeshake';
declare const inputOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>;
declare const externalSchema: 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]>>]>;
declare const jsxOptionsSchema: 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, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}>;
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, {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: string[] | undefined;
symlinks?: boolean | undefined;
tsconfigFilename?: string | undefined;
}, {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: 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.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>;
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, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
}, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: 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, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | 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, {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
}, {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
}>, z.ZodLiteral<false>]>>;
}, "strict", z.ZodTypeAny, {
input?: string | string[] | Record<string, string> | undefined;
plugins?: RolldownPluginRec[] | undefined;
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined;
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?: {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: string[] | undefined;
symlinks?: boolean | undefined;
tsconfigFilename?: string | undefined;
} | undefined;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | TreeshakingOptions | 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;
jsx?: {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "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?: {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
} | undefined;
define?: Record<string, string> | undefined;
inject?: Record<string, string | [string, string]> | undefined;
profilerNames?: boolean | undefined;
watch?: false | {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
} | undefined;
}, {
input?: string | string[] | Record<string, string> | undefined;
plugins?: RolldownPluginRec[] | undefined;
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined;
resolve?: {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: string[] | undefined;
symlinks?: boolean | undefined;
tsconfigFilename?: string | undefined;
} | undefined;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | TreeshakingOptions | 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;
jsx?: {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
experimental?: {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
} | undefined;
define?: Record<string, string> | undefined;
inject?: Record<string, string | [string, string]> | undefined;
profilerNames?: boolean | undefined;
watch?: false | {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
} | 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, {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: string[] | undefined;
symlinks?: boolean | undefined;
tsconfigFilename?: string | undefined;
}, {
alias?: Record<string, string> | undefined;
aliasFields?: string[][] | undefined;
conditionNames?: string[] | undefined;
extensionAlias?: Record<string, string[]> | undefined;
exportsFields?: string[][] | undefined;
extensions?: string[] | undefined;
mainFields?: string[] | undefined;
mainFiles?: string[] | undefined;
modules?: 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.ZodType<boolean | TreeshakingOptions, z.ZodTypeDef, boolean | TreeshakingOptions>>;
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, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: boolean | undefined;
}, {
enableComposingJsPlugins?: boolean | undefined;
strictExecutionOrder?: boolean | undefined;
disableLiveBindings?: 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, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
}, {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | 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, {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
}, {
skipWrite?: boolean | undefined;
notify?: {
pollInterval?: number | undefined;
compareContents?: boolean | undefined;
} | undefined;
include?: string | RegExp | (string | RegExp)[] | undefined;
exclude?: string | RegExp | (string | RegExp)[] | undefined;
chokidar?: any;
}>, z.ZodLiteral<false>]>>;
}, {
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;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | undefined;
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
jsx?: {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
define?: Record<string, string> | undefined;
inject?: Record<string, string> | undefined;
}, {
external?: string[] | undefined;
cwd?: string | undefined;
platform?: "node" | "browser" | "neutral" | undefined;
shimMissingExports?: boolean | undefined;
treeshake?: boolean | undefined;
logLevel?: "info" | "debug" | "warn" | "silent" | undefined;
jsx?: {
mode?: "classic" | "automatic" | undefined;
factory?: string | undefined;
fragment?: string | undefined;
importSource?: string | undefined;
jsxImportSource?: string | undefined;
refresh?: boolean | undefined;
development?: boolean | undefined;
} | undefined;
moduleTypes?: Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css"> | undefined;
define?: Record<string, string> | undefined;
inject?: Record<string, string> | undefined;
}>;
type RawInputOptions = z.infer<typeof inputOptionsSchema>;
interface OverwriteInputOptionsWithDoc {
enableComposingJsPlugins?: boolean;
strictExecutionOrder?: boolean;
disableLiveBindings?: boolean;
viteMode?: boolean;
resolveNewUrlToAsset?: boolean;
};
define?: Record<string, string>;
/**

@@ -452,8 +90,15 @@ * Inject import statements on demand.

*/
inject?: RawInputOptions['inject'];
inject?: Record<string, string | [string, string]>;
profilerNames?: boolean;
jsx?: JsxOptions;
watch?: WatchOptions | false;
dropLabels?: string[];
keepNames?: boolean;
}
export type InputOption = z.infer<typeof inputOptionSchema>;
export type InputOptions = Omit<RawInputOptions, keyof OverwriteInputOptionsWithDoc> & OverwriteInputOptionsWithDoc;
export type ExternalOption = z.infer<typeof externalSchema>;
export type JsxOptions = z.infer<typeof jsxOptionsSchema>;
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 './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";
}

@@ -0,27 +1,63 @@

import type { BindingNormalizedOptions } from '../binding';
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup';
import type { OutputOptions } from './output-options';
import type { RolldownPlugin } from '../plugin';
import type { PreRenderedChunk, RenderedChunk } from '../binding';
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd';
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
type ChunkFileNamesOption = string | ((chunk: PreRenderedChunk) => string) | undefined;
export interface NormalizedOutputOptions extends OutputOptions {
plugins: RolldownPlugin[];
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;
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';
extend: boolean;
globals: Record<string, string> | GlobalsFunction;
hashCharacters: 'base64' | 'base36' | 'hex';
sourcemapDebugIds: boolean;
sourcemapIgnoreList: SourcemapIgnoreListOption | undefined;
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
banner: AddonFunction;
footer: AddonFunction;
intro: AddonFunction;
outro: AddonFunction;
esModule: boolean | 'if-default-prop';
entryFileNames: ChunkFileNamesOption;
chunkFileNames: ChunkFileNamesOption;
assetFileNames: string;
name: string | undefined;
inlineDynamicImports: boolean;
minify: boolean;
comments: 'none' | 'preserve-legal';
}
export {};
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,270 +0,77 @@

import type { PreRenderedChunk, RenderedChunk } from '../binding';
import { z } from 'zod';
declare const ModuleFormatSchema: 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">]>>;
declare const outputOptionsSchema: z.ZodObject<{
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">]>>;
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]>>;
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>]>>;
assetFileNames: z.ZodOptional<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;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}, {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}>, "many">>;
}, "strict", z.ZodTypeAny, {
minSize?: number | undefined;
minShareCount?: number | undefined;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
}, {
minSize?: number | undefined;
minShareCount?: number | undefined;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
}>>;
}, "strict", z.ZodTypeAny, {
footer?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
banner?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
intro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
outro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
file?: string | undefined;
name?: string | undefined;
exports?: "auto" | "named" | "default" | "none" | undefined;
dir?: string | undefined;
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
sourcemap?: boolean | "inline" | "hidden" | undefined;
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined;
sourcemapPathTransform?: SourcemapPathTransformOption | undefined;
extend?: boolean | undefined;
esModule?: boolean | "if-default-prop" | undefined;
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: boolean | 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 | undefined;
minShareCount?: number | undefined;
minSize?: number;
minShareCount?: number;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
} | undefined;
}, {
footer?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
banner?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
intro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
outro?: string | ((args_0: RenderedChunk, ...args: unknown[]) => string | Promise<string>) | undefined;
file?: string | undefined;
name?: string | undefined;
exports?: "auto" | "named" | "default" | "none" | undefined;
dir?: string | undefined;
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
sourcemap?: boolean | "inline" | "hidden" | undefined;
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption | undefined;
sourcemapPathTransform?: SourcemapPathTransformOption | undefined;
extend?: boolean | undefined;
esModule?: boolean | "if-default-prop" | undefined;
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: 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;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
} | undefined;
}>;
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">]>>;
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]>>;
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>]>>;
assetFileNames: z.ZodOptional<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;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}, {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}>, "many">>;
}, "strict", z.ZodTypeAny, {
minSize?: number | undefined;
minShareCount?: number | undefined;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
}, {
minSize?: number | undefined;
minShareCount?: number | undefined;
groups?: {
name: string;
minSize?: number | undefined;
minShareCount?: number | undefined;
test?: string | RegExp | undefined;
priority?: number | undefined;
}[] | undefined;
}>>;
}, {
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;
dir?: string | undefined;
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
sourcemap?: boolean | "inline" | "hidden" | undefined;
extend?: boolean | undefined;
esModule?: boolean | undefined;
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: boolean | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
} | 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;
dir?: string | undefined;
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined;
sourcemap?: boolean | "inline" | "hidden" | undefined;
extend?: boolean | undefined;
esModule?: boolean | undefined;
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined;
assetFileNames?: string | undefined;
minify?: boolean | undefined;
globals?: Record<string, string> | undefined;
externalLiveBindings?: boolean | undefined;
inlineDynamicImports?: boolean | undefined;
advancedChunks?: {
minSize?: number | undefined;
minShareCount?: number | undefined;
} | undefined;
}>;
export type OutputOptions = z.infer<typeof outputOptionsSchema>;
export type SourcemapIgnoreListOption = (relativeSourcePath: string, sourcemapPath: string) => boolean;
export type SourcemapPathTransformOption = (relativeSourcePath: string, sourcemapPath: string) => string;
export type ModuleFormat = z.infer<typeof ModuleFormatSchema>;
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']>;
import type { MaybeArray } from '../types/utils';
import type { StringOrRegExp } from '../constants/types';
import type { StringOrRegExp } from '../types/utils';
import type { ModuleType } from '../index';

@@ -4,0 +4,0 @@ export type StringFilter = MaybeArray<StringOrRegExp> | {

@@ -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,3 +129,5 @@ export interface OutputPlugin extends Partial<{

export type RolldownPlugin<A = any> = Plugin<A> | BuiltinPlugin | ParallelPlugin;
export type RolldownPluginRec<A = any> = RolldownPlugin<A> | RolldownPlugin<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 {};
import { BindingPluginContext } from '../binding';
import { ModuleInfo, ModuleOptions } from '..';
import { ModuleOptions } from '..';
import { PluginContextResolveOptions } from './plugin-context';
export declare class PluginContextData {
modules: Map<string, ModuleInfo>;
moduleIds: Array<string> | null;
moduleOptionMap: Map<string, ModuleOptions>;
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
loadModulePromiseMap: Map<string, Promise<void>>;
updateModuleOption(id: string, option: ModuleOptions): void;
getModuleOption(id: string): ModuleOptions | undefined;
getModuleInfo(id: string, context: BindingPluginContext): ModuleInfo | null;
getModuleOption(id: string): ModuleOptions;
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null;
getModuleIds(context: BindingPluginContext): ArrayIterator<string>;

@@ -13,0 +12,0 @@ saveResolveOptions(options: PluginContextResolveOptions): number;

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,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';

@@ -909,4 +909,8 @@ // utils

export interface PreRenderedAsset {
/** @deprecated Use "names" instead. */
name: string | undefined
names: string[]
/** @deprecated Use "originalFileNames" instead. */
originalFileName: string | null
originalFileNames: string[]
source: string | Uint8Array

@@ -913,0 +917,0 @@ type: 'asset'

@@ -1,13 +0,1 @@

export declare const TreeshakingOptionsSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<{
moduleSideEffects: import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>;
}, {
moduleSideEffects: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodBoolean, import("zod").ZodString]>>;
}>, "strict", import("zod").ZodTypeAny, {
moduleSideEffects?: string | boolean | undefined;
}, {
moduleSideEffects?: string | boolean | undefined;
}>;
export interface TreeshakingOptions {
moduleSideEffects?: boolean | RegExp;
}
export * from './module-side-effects';
import { z } from 'zod';
export declare const HasModuleSideEffectsSchema: z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodBoolean>;
export type HasModuleSideEffects = z.infer<typeof HasModuleSideEffectsSchema>;
export type ModuleSideEffectsOption = z.infer<typeof ModuleSideEffectsOptionSchema>;
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
export declare const NormalizedTreeshakingOptionsSchema: z.ZodObject<{
moduleSideEffects: z.ZodUnion<[z.ZodBoolean, z.ZodString]>;
}, "strict", z.ZodTypeAny, {
moduleSideEffects: string | boolean;
export declare const ModuleSideEffectsRuleSchema: 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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
moduleSideEffects: string | boolean;
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>;
export type NormalizedTreeshakingOptions = {
moduleSideEffects: string;
};
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>;
export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
moduleSideEffects: z.ZodOptional<z.ZodUnion<[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;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}, {
sideEffects: boolean;
external?: boolean | undefined;
test?: RegExp | undefined;
}>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodBoolean], z.ZodUnknown>, z.ZodOptional<z.ZodBoolean>>]>, z.ZodLiteral<"no-external">]>>;
annotations: z.ZodOptional<z.ZodBoolean>;
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>;
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>;
import { AssetSource } from '../utils/asset-source';
import type { RenderedModule } from './rendered-module';
import type { RenderedChunk } from '../binding';
export interface RolldownOutputAsset {
type: 'asset';
fileName: string;
/** @deprecated Use "originalFileNames" instead. */
originalFileName: string | null;
originalFileNames: string[];
source: AssetSource;
/** @deprecated Use "names" instead. */
name: string | undefined;
names: string[];
}

@@ -18,2 +22,11 @@ export interface SourceMap {

}
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 +40,3 @@ type: 'chunk';

modules: {
[id: string]: RenderedModule;
[id: string]: RolldownRenderedModule;
};

@@ -30,0 +43,0 @@ imports: string[];

@@ -13,1 +13,2 @@ export type MaybePromise<T> = T | Promise<T>;

export type MaybeArray<T> = T | T[];
export type StringOrRegExp = string | RegExp;

@@ -0,2 +1,5 @@

import type { RolldownOptions } from '../types/rolldown-options';
import type { ConfigExport } from '../types/config-export';
export declare function defineConfig(config: RolldownOptions): RolldownOptions;
export declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
export declare function defineConfig(config: ConfigExport): ConfigExport;
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 { RolldownPlugin, RolldownOutputPlugin } from '../plugin';
import type { InputOptions } from '../options/input-options';
import type { RolldownPlugin } from '../plugin';
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 ";

@@ -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 {

{
"name": "rolldown",
"version": "0.14.0",
"version": "0.15.0-snapshot-22747a3-20241206003640",
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",

@@ -47,3 +47,2 @@ "homepage": "https://rolldown.rs/",

},
"./watcher-worker": "./dist/shared/watcher-worker.js",
"./package.json": "./package.json"

@@ -86,9 +85,18 @@ },

},
"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",

@@ -103,24 +111,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"
"rolldown": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/testing": "0.0.1"
},
"optionalDependencies": {
"@rolldown/binding-darwin-arm64": "0.14.0",
"@rolldown/binding-darwin-x64": "0.14.0",
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0",
"@rolldown/binding-linux-arm64-musl": "0.14.0",
"@rolldown/binding-freebsd-x64": "0.14.0",
"@rolldown/binding-linux-arm64-gnu": "0.14.0",
"@rolldown/binding-linux-x64-musl": "0.14.0",
"@rolldown/binding-linux-x64-gnu": "0.14.0",
"@rolldown/binding-win32-arm64-msvc": "0.14.0",
"@rolldown/binding-win32-ia32-msvc": "0.14.0",
"@rolldown/binding-win32-x64-msvc": "0.14.0",
"@rolldown/binding-wasm32-wasi": "0.14.0"
"@rolldown/binding-darwin-arm64": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-freebsd-x64": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-darwin-x64": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-linux-arm-gnueabihf": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-linux-arm64-gnu": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-linux-arm64-musl": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-linux-x64-gnu": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-wasm32-wasi": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-linux-x64-musl": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-win32-arm64-msvc": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-win32-ia32-msvc": "0.15.0-snapshot-22747a3-20241206003640",
"@rolldown/binding-win32-x64-msvc": "0.15.0-snapshot-22747a3-20241206003640"
},

@@ -136,3 +144,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",

@@ -142,6 +150,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",

@@ -148,0 +156,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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc