Comparing version 0.14.0-snapshot-0e16a9a-20241119003440 to 0.14.0-snapshot-11a6693-20241126041222
@@ -11,4 +11,8 @@ type MaybePromise<T> = T | Promise<T> | ||
export declare class BindingBundleEndEventData { | ||
output: string | ||
duration: number | ||
} | ||
export declare class BindingCallableBuiltinPlugin { | ||
name: string | ||
constructor(plugin: BindingBuiltinPlugin) | ||
@@ -35,2 +39,12 @@ resolveId(id: string, importer?: string | undefined | null, options?: BindingHookJsResolveIdOptions | undefined | null): Promise<BindingHookJsResolveIdOutput | null> | ||
export declare class BindingNormalizedOptions { | ||
get shimMissingExports(): boolean | ||
get input(): Array<string> | Record<string, string> | ||
get dir(): string | null | ||
get entryFilenames(): string | null | ||
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd' | ||
get inlineDynamicImports(): boolean | ||
get sourcemap(): boolean | 'inline' | 'hidden' | ||
} | ||
export declare class BindingOutputAsset { | ||
@@ -86,6 +100,18 @@ get fileName(): string | ||
close(): Promise<void> | ||
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void | ||
start(): Promise<void> | ||
start(listener: (data: BindingWatcherEvent) => void): Promise<void> | ||
} | ||
export declare class BindingWatcherChangeData { | ||
path: string | ||
kind: string | ||
} | ||
export declare class BindingWatcherEvent { | ||
eventKind(): string | ||
watchChangeData(): BindingWatcherChangeData | ||
bundleEndData(): BindingBundleEndEventData | ||
bundleEventKind(): string | ||
errors(): Array<unknown> | ||
} | ||
export declare class Bundler { | ||
@@ -156,17 +182,15 @@ constructor(inputOptions: BindingInputOptions, outputOptions: BindingOutputOptions, parallelPluginsRegistry?: ParallelJsPluginRegistry | undefined | null) | ||
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, | ||
ViteResolvePlugin = 12 | ||
} | ||
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'; | ||
@@ -183,2 +207,3 @@ export interface BindingEmittedAsset { | ||
disableLiveBindings?: boolean | ||
viteMode?: boolean | ||
} | ||
@@ -274,3 +299,3 @@ | ||
platform?: 'node' | 'browser' | 'neutral' | ||
logLevel?: BindingLogLevel | ||
logLevel: BindingLogLevel | ||
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void | ||
@@ -358,3 +383,3 @@ cwd: string | ||
format?: 'es' | 'cjs' | 'iife' | 'umd' | ||
globals?: Record<string, string> | ||
globals?: Record<string, string> | ((name: string) => string) | ||
hashCharacters?: 'base64' | 'base36' | 'hex' | ||
@@ -391,3 +416,3 @@ inlineDynamicImports?: boolean | ||
name: string | ||
buildStart?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable> | ||
buildStartMeta?: BindingPluginHookMeta | ||
@@ -409,13 +434,13 @@ resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>> | ||
buildEndMeta?: BindingPluginHookMeta | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: RenderedChunk, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>> | ||
renderChunkMeta?: BindingPluginHookMeta | ||
augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string> | ||
augmentChunkHashMeta?: BindingPluginHookMeta | ||
renderStart?: (ctx: BindingPluginContext) => void | ||
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void | ||
renderStartMeta?: BindingPluginHookMeta | ||
renderError?: (ctx: BindingPluginContext, error: string) => void | ||
renderErrorMeta?: BindingPluginHookMeta | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
generateBundleMeta?: BindingPluginHookMeta | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>> | ||
writeBundleMeta?: BindingPluginHookMeta | ||
@@ -493,2 +518,3 @@ closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable> | ||
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ||
annotations?: boolean | ||
} | ||
@@ -512,2 +538,3 @@ | ||
preferRelative: boolean | ||
isRequire?: boolean | ||
root: string | ||
@@ -524,9 +551,2 @@ scan: boolean | ||
export declare enum BindingWatcherEvent { | ||
Close = 0, | ||
Event = 1, | ||
ReStart = 2, | ||
Change = 3 | ||
} | ||
export interface BindingWatchOption { | ||
@@ -549,4 +569,2 @@ skipWrite?: boolean | ||
export declare function isCallableCompatibleBuiltinPlugin(plugin: BindingBuiltinPlugin): boolean | ||
/** TypeScript Isolated Declarations for Standalone DTS Emit */ | ||
@@ -692,3 +710,3 @@ export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult | ||
* | ||
* 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} | ||
* | ||
@@ -695,0 +713,0 @@ * @default false |
import { CliOptions } from './schema'; | ||
import type { InputOptions } from '../../types/input-options'; | ||
import type { OutputOptions } from '../../types/output-options'; | ||
import type { InputOptions } from '../../options/input-options'; | ||
import type { OutputOptions } from '../../options/output-options'; | ||
export interface NormalizedCliOptions { | ||
@@ -5,0 +5,0 @@ input: InputOptions; |
@@ -59,17 +59,18 @@ import type { ObjectSchema } from './types'; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
@@ -82,17 +83,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
@@ -105,17 +107,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
@@ -206,3 +209,3 @@ logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
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>; | ||
@@ -229,3 +232,3 @@ file: z.ZodOptional<z.ZodString>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
globals: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodString>, z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodString>]>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
@@ -283,2 +286,3 @@ inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
@@ -295,30 +299,11 @@ minSize: z.ZodOptional<z.ZodNumber>; | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">>, "strict", z.ZodTypeAny, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: boolean | undefined; | ||
dropLabels?: string[] | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
@@ -339,19 +324,6 @@ minSize?: number | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
version?: boolean | undefined; | ||
config?: string | boolean | undefined; | ||
help?: boolean | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
@@ -366,12 +338,25 @@ development?: boolean | undefined; | ||
} | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | 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; | ||
}, { | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
banner?: string | undefined; | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
advancedChunks?: { | ||
@@ -392,11 +377,30 @@ minSize?: number | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
version?: boolean | undefined; | ||
external?: string[] | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
treeshake?: boolean | undefined; | ||
inject?: Record<string, string> | undefined; | ||
watch?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | 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_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", "augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle", "footer", "banner", "intro", "outro", "closeBundle", "watchChange", "closeWatcher"]; | ||
/** | ||
@@ -4,0 +5,0 @@ * Names of all properties in a `Plugin` object. Includes `name` and `api`. |
@@ -6,2 +6,5 @@ export { defineParallelPlugin } from './plugin/parallel-plugin'; | ||
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins'; | ||
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, viteResolvePlugin, isCallableCompatibleBuiltinPlugin, makeBuiltinPluginCallable, isCallableBuiltinPlugin, } 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'; |
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './types/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './types/output-options'; | ||
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options'; | ||
import type { ModuleFormat, OutputOptions } from './options/output-options'; | ||
import type { RolldownOptions } from './types/rolldown-options'; | ||
@@ -18,10 +18,11 @@ import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin'; | ||
import { ModuleInfo } from './types/module-info'; | ||
import { MinimalPluginContext } from './log/logger'; | ||
import { MinimalPluginContext } from './plugin/minimal-plugin-context'; | ||
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap'; | ||
import { OutputBundle } from './types/output-bundle'; | ||
import { WatchOptions } from './options/watch-option'; | ||
import { WatchOptions } from './options/watch-options'; | ||
import { Watcher } from './watcher'; | ||
export { defineConfig, rolldown, watch }; | ||
export declare const VERSION: string; | ||
export type { RolldownOutputAsset, RolldownOutputChunk, RolldownOptions, RolldownOutput, RolldownBuild, InputOptions, NormalizedInputOptions, OutputOptions, NormalizedOutputOptions, Plugin, RolldownPlugin, DefineParallelPluginResult, ConfigExport, ImportKind, InputOption, ExternalOption, ModuleFormat, ModuleType, InternalModuleFormat, LoadResult, TransformResult, ResolveIdResult, PluginContext, TransformPluginContext, ObjectHook, RenderedChunk, PreRenderedChunk, SourceMap, SourceDescription, PartialNull, PartialResolvedId, ResolvedId, ModuleOptions, ModuleInfo, MinimalPluginContext, EmittedFile, EmittedAsset, CustomPluginOptions, AsyncPluginHooks, ParallelPluginHooks, FunctionPluginHooks, ExistingRawSourceMap, SourceMapInput, OutputBundle, JsxOptions, WatchOptions, }; | ||
export type { 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, Watcher, }; | ||
export type { RolldownOutput as RollupOutput, RolldownOptions as RollupOptions, RolldownBuild as RollupBuild, RolldownOutputChunk as OutputChunk, RolldownOutputAsset as OutputAsset, }; | ||
export type { RollupError, RollupLog, LoggingFunction } from './rollup'; |
@@ -1,20 +0,6 @@ | ||
import type { LoggingFunction, LogHandler, RollupError } from '../rollup'; | ||
import type { LogHandler } from '../rollup'; | ||
import type { Plugin } from '../plugin'; | ||
import { type LogLevelOption } from './logging'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
export interface PluginContextMeta { | ||
rollupVersion: string; | ||
rolldownVersion: string; | ||
watchMode: boolean; | ||
} | ||
export declare class MinimalPluginContext { | ||
debug: LoggingFunction; | ||
info: LoggingFunction; | ||
meta: PluginContextMeta; | ||
warn: LoggingFunction; | ||
readonly error: (error: RollupError | string) => never; | ||
constructor(options: NormalizedInputOptions, plugin: Plugin); | ||
} | ||
import type { InputOptions } from '../options/input-options'; | ||
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => NormalizedInputOptions["onLog"]; | ||
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler; |
@@ -1,580 +0,101 @@ | ||
import { z } from 'zod'; | ||
import type { RolldownPluginRec } from '../plugin'; | ||
export declare const inputOptionsSchema: z.ZodObject<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
treeshake?: boolean | z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
import { RolldownPluginRec } from '../plugin'; | ||
import { LogLevel, LogLevelOption, LogLevelWithError, RollupLog, RollupLogWithString } from '../log/logging'; | ||
import { TreeshakingOptions } from '../treeshake'; | ||
import { NullValue, StringOrRegExp } from '../types/utils'; | ||
export type InputOption = string | string[] | Record<string, string>; | ||
export type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>); | ||
export type ModuleTypes = Record<string, 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | 'css'>; | ||
export interface JsxOptions { | ||
mode?: 'classic' | 'automatic'; | ||
factory?: string; | ||
fragment?: string; | ||
importSource?: string; | ||
jsxImportSource?: string; | ||
refresh?: boolean; | ||
development?: boolean; | ||
} | ||
export interface WatchOptions { | ||
skipWrite?: boolean; | ||
notify?: { | ||
pollInterval?: number; | ||
compareContents?: boolean; | ||
}; | ||
include?: StringOrRegExp | StringOrRegExp[]; | ||
exclude?: StringOrRegExp | StringOrRegExp[]; | ||
chokidar?: any; | ||
} | ||
export interface InputOptions { | ||
input?: InputOption; | ||
plugins?: RolldownPluginRec[]; | ||
external?: ExternalOption; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
alias?: Record<string, string>; | ||
aliasFields?: string[][]; | ||
conditionNames?: string[]; | ||
extensionAlias?: Record<string, string[]>; | ||
exportsFields?: string[][]; | ||
extensions?: string[]; | ||
mainFields?: string[]; | ||
mainFiles?: string[]; | ||
modules?: string[]; | ||
symlinks?: boolean; | ||
tsconfigFilename?: string; | ||
}; | ||
cwd?: string; | ||
/** | ||
* Expected platform where the code run. | ||
* | ||
* @default | ||
* - 'node' if the format is 'cjs' | ||
* - 'browser' for other formats | ||
*/ | ||
platform?: 'node' | 'browser' | 'neutral'; | ||
shimMissingExports?: boolean; | ||
treeshake?: boolean | TreeshakingOptions; | ||
logLevel?: LogLevelOption; | ||
onLog?: (level: LogLevel, log: RollupLog, defaultHandler: (level: LogLevelWithError, log: RollupLogWithString) => void) => void; | ||
onwarn?: (warning: RollupLog, defaultHandler: (warning: RollupLogWithString | (() => RollupLogWithString)) => void) => void; | ||
moduleTypes?: ModuleTypes; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
external?: string | RegExp | (string | RegExp)[] | ((args_0: string, args_1: string | undefined, args_2: boolean, ...args: unknown[]) => boolean | void | null | undefined) | undefined; | ||
treeshake?: boolean | z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough"> | undefined; | ||
input?: string | string[] | Record<string, string> | undefined; | ||
plugins?: RolldownPluginRec[] | undefined; | ||
resolve?: { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
} | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
onLog?: ((args_0: "info" | "debug" | "warn", args_1: any, args_2: (args_0: "info" | "debug" | "warn" | "error", args_1: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
onwarn?: ((args_0: any, args_1: (args_0: any, ...args: unknown[]) => unknown, ...args: unknown[]) => unknown) | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
experimental?: { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
} | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string | [string, string]> | undefined; | ||
profilerNames?: boolean | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
watch?: false | { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
export declare const inputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
input: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodRecord<z.ZodString, z.ZodString>]>>; | ||
plugins: z.ZodOptional<z.ZodArray<z.ZodType<RolldownPluginRec, z.ZodTypeDef, RolldownPluginRec>, "many">>; | ||
external: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>, z.ZodFunction<z.ZodTuple<[z.ZodString, z.ZodOptional<z.ZodString>, z.ZodBoolean], z.ZodUnknown>, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodVoid, z.ZodNull]>, z.ZodUndefined]>, z.ZodBoolean]>>]>>; | ||
resolve: z.ZodOptional<z.ZodObject<{ | ||
alias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
aliasFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
conditionNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
extensionAlias: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>; | ||
exportsFields: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>; | ||
extensions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
mainFiles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
modules: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
symlinks: z.ZodOptional<z.ZodBoolean>; | ||
tsconfigFilename: z.ZodOptional<z.ZodString>; | ||
}, "strict", z.ZodTypeAny, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}, { | ||
modules?: string[] | undefined; | ||
alias?: Record<string, string> | undefined; | ||
extensionAlias?: Record<string, string[]> | undefined; | ||
aliasFields?: string[][] | undefined; | ||
conditionNames?: string[] | undefined; | ||
exportsFields?: string[][] | undefined; | ||
extensions?: string[] | undefined; | ||
mainFields?: string[] | undefined; | ||
mainFiles?: string[] | undefined; | ||
symlinks?: boolean | undefined; | ||
tsconfigFilename?: string | undefined; | ||
}>>; | ||
cwd: z.ZodOptional<z.ZodString>; | ||
platform: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"node">, z.ZodLiteral<"browser">]>, z.ZodLiteral<"neutral">]>>; | ||
shimMissingExports: z.ZodOptional<z.ZodBoolean>; | ||
treeshake: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
external: z.ZodOptional<z.ZodBoolean>; | ||
sideEffects: z.ZodBoolean; | ||
}, "strip", z.ZodTypeAny, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>>; | ||
logLevel: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"silent">]>>; | ||
onLog: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"info">, z.ZodLiteral<"debug">]>, z.ZodLiteral<"warn">]>, z.ZodLiteral<"error">]>, z.ZodUnion<[z.ZodAny, z.ZodString]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
onwarn: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodFunction<z.ZodTuple<[z.ZodUnion<[z.ZodUnion<[z.ZodAny, z.ZodString]>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodUnion<[z.ZodAny, z.ZodString]>>]>], z.ZodUnknown>, z.ZodUnknown>], z.ZodUnknown>, z.ZodUnknown>>; | ||
moduleTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"js">, z.ZodLiteral<"jsx">]>, z.ZodLiteral<"ts">]>, z.ZodLiteral<"tsx">]>, z.ZodLiteral<"json">]>, z.ZodLiteral<"text">]>, z.ZodLiteral<"base64">]>, z.ZodLiteral<"dataurl">]>, z.ZodLiteral<"binary">]>, z.ZodLiteral<"empty">]>, z.ZodLiteral<"css">]>>>; | ||
experimental: z.ZodOptional<z.ZodObject<{ | ||
enableComposingJsPlugins: z.ZodOptional<z.ZodBoolean>; | ||
strictExecutionOrder: z.ZodOptional<z.ZodBoolean>; | ||
disableLiveBindings: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}, { | ||
strictExecutionOrder?: boolean | undefined; | ||
disableLiveBindings?: boolean | undefined; | ||
enableComposingJsPlugins?: boolean | undefined; | ||
}>>; | ||
define: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>>; | ||
profilerNames: z.ZodOptional<z.ZodBoolean>; | ||
jsx: z.ZodOptional<z.ZodObject<{ | ||
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"automatic">]>>; | ||
factory: z.ZodOptional<z.ZodString>; | ||
fragment: z.ZodOptional<z.ZodString>; | ||
importSource: z.ZodOptional<z.ZodString>; | ||
jsxImportSource: z.ZodOptional<z.ZodString>; | ||
refresh: z.ZodOptional<z.ZodBoolean>; | ||
development: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}, { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
}>>; | ||
watch: z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
skipWrite: z.ZodOptional<z.ZodBoolean>; | ||
notify: z.ZodOptional<z.ZodObject<{ | ||
pollInterval: z.ZodOptional<z.ZodNumber>; | ||
compareContents: z.ZodOptional<z.ZodBoolean>; | ||
}, "strict", z.ZodTypeAny, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}, { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
}>>; | ||
include: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
exclude: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>, "many">]>>; | ||
chokidar: z.ZodOptional<z.ZodAny>; | ||
}, "strict", z.ZodTypeAny, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}, { | ||
include?: string | RegExp | (string | RegExp)[] | undefined; | ||
exclude?: string | RegExp | (string | RegExp)[] | undefined; | ||
notify?: { | ||
pollInterval?: number | undefined; | ||
compareContents?: boolean | undefined; | ||
} | undefined; | ||
skipWrite?: boolean | undefined; | ||
chokidar?: any; | ||
}>, z.ZodLiteral<false>]>>; | ||
dropLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
}, { | ||
external: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; | ||
inject: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
treeshake: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
}>, "input" | "plugins" | "resolve" | "onLog" | "onwarn" | "experimental" | "profilerNames" | "watch">, "strict", z.ZodTypeAny, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}, { | ||
external?: string[] | undefined; | ||
treeshake?: boolean | undefined; | ||
cwd?: string | undefined; | ||
platform?: "node" | "browser" | "neutral" | undefined; | ||
shimMissingExports?: boolean | undefined; | ||
logLevel?: "info" | "debug" | "warn" | "silent" | undefined; | ||
moduleTypes?: Record<string, "jsx" | "base64" | "js" | "ts" | "tsx" | "json" | "text" | "dataurl" | "binary" | "empty" | "css"> | undefined; | ||
define?: Record<string, string> | undefined; | ||
inject?: Record<string, string> | undefined; | ||
jsx?: { | ||
development?: boolean | undefined; | ||
refresh?: boolean | undefined; | ||
mode?: "classic" | "automatic" | undefined; | ||
factory?: string | undefined; | ||
fragment?: string | undefined; | ||
importSource?: string | undefined; | ||
jsxImportSource?: string | undefined; | ||
} | undefined; | ||
dropLabels?: string[] | undefined; | ||
}>; | ||
enableComposingJsPlugins?: boolean; | ||
strictExecutionOrder?: boolean; | ||
disableLiveBindings?: boolean; | ||
viteMode?: boolean; | ||
}; | ||
define?: Record<string, string>; | ||
/** | ||
* Inject import statements on demand. | ||
* | ||
* ## Supported patterns | ||
* ```js | ||
* { | ||
* // import { Promise } from 'es6-promise' | ||
* Promise: ['es6-promise', 'Promise'], | ||
* | ||
* // import { Promise as P } from 'es6-promise' | ||
* P: ['es6-promise', 'Promise'], | ||
* | ||
* // import $ from 'jquery' | ||
* $: 'jquery', | ||
* | ||
* // import * as fs from 'node:fs' | ||
* fs: ['node:fs', '*'], | ||
* | ||
* // Inject shims for property access pattern | ||
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ), | ||
* } | ||
* ``` | ||
*/ | ||
inject?: Record<string, string | [string, string]>; | ||
profilerNames?: boolean; | ||
jsx?: JsxOptions; | ||
watch?: WatchOptions | false; | ||
dropLabels?: string[]; | ||
} | ||
interface OverwriteInputOptionsForCli { | ||
external?: string[]; | ||
inject?: Record<string, string>; | ||
treeshake?: boolean; | ||
} | ||
export type InputCliOptions = Omit<InputOptions, keyof OverwriteInputOptionsForCli | 'input' | 'plugins' | 'onwarn' | 'onLog' | 'resolve' | 'experimental' | 'profilerNames' | 'watch'> & OverwriteInputOptionsForCli; | ||
export {}; |
@@ -1,12 +0,13 @@ | ||
import type { LogLevelOption, RollupLog, NormalizedInputOptions as RollupNormalizedInputOptions } from '../rollup'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { LogLevel } from '../log/logging'; | ||
import { NormalizedTreeshakingOptions } from '../treeshake'; | ||
export interface NormalizedInputOptions extends Omit<InputOptions, 'treeshake'> { | ||
input: RollupNormalizedInputOptions['input']; | ||
plugins: RolldownPlugin[]; | ||
onLog: (level: LogLevel, log: RollupLog) => void; | ||
logLevel: LogLevelOption; | ||
treeshake?: NormalizedTreeshakingOptions; | ||
import type { LogHandler } from '../rollup'; | ||
import { BindingNormalizedOptions } from '../binding'; | ||
export interface NormalizedInputOptions { | ||
shimMissingExports: boolean; | ||
input: string[] | Record<string, string>; | ||
} | ||
export declare class NormalizedInputOptionsImpl implements NormalizedInputOptions { | ||
onLog: LogHandler; | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions, onLog: LogHandler); | ||
get shimMissingExports(): boolean; | ||
get input(): Record<string, string> | string[]; | ||
} |
@@ -1,18 +0,19 @@ | ||
import type { SourcemapIgnoreListOption } from '../rollup'; | ||
import type { AddonFunction, OutputOptions } from '../types/output-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd'; | ||
export interface NormalizedOutputOptions extends OutputOptions { | ||
plugins: RolldownPlugin[]; | ||
import type { BindingNormalizedOptions } from '../binding'; | ||
import { ChunkFileNamesFunction } from './output-options'; | ||
export type InternalModuleFormat = 'es' | 'cjs' | 'iife' | 'umd' | 'app'; | ||
export interface NormalizedOutputOptions { | ||
dir: string | undefined; | ||
entryFileNames: string | ChunkFileNamesFunction; | ||
format: InternalModuleFormat; | ||
exports: 'auto' | 'named' | 'default' | 'none'; | ||
inlineDynamicImports: boolean; | ||
sourcemap: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList: SourcemapIgnoreListOption; | ||
banner: AddonFunction; | ||
footer: AddonFunction; | ||
intro: AddonFunction; | ||
outro: AddonFunction; | ||
esModule: boolean | 'if-default-prop'; | ||
assetFileNames: string; | ||
inlineDynamicImports: boolean; | ||
} | ||
export declare class NormalizedOutputOptionsImpl implements NormalizedOutputOptions { | ||
inner: BindingNormalizedOptions; | ||
constructor(inner: BindingNormalizedOptions); | ||
get dir(): string | undefined; | ||
get entryFileNames(): string | (() => never); | ||
get format(): "es" | "cjs" | "iife" | "umd" | "app"; | ||
get inlineDynamicImports(): boolean; | ||
get sourcemap(): boolean | "inline" | "hidden"; | ||
} |
@@ -1,145 +0,76 @@ | ||
import { z } from 'zod'; | ||
import type { StringOrRegExp } from '../types/utils'; | ||
import type { RenderedChunk, PreRenderedChunk } from '../binding'; | ||
import type { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
export declare const outputCliOptionsSchema: z.ZodObject<Omit<z.objectUtil.extendShape<{ | ||
dir: z.ZodOptional<z.ZodString>; | ||
file: z.ZodOptional<z.ZodString>; | ||
exports: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"auto">, z.ZodLiteral<"named">]>, z.ZodLiteral<"default">]>, z.ZodLiteral<"none">]>>; | ||
hashCharacters: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"base64">, z.ZodLiteral<"base36">]>, z.ZodLiteral<"hex">]>>; | ||
format: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"es">, z.ZodLiteral<"cjs">]>, z.ZodLiteral<"esm">]>, z.ZodLiteral<"module">]>, z.ZodLiteral<"commonjs">]>, z.ZodLiteral<"iife">]>, z.ZodLiteral<"umd">]>>; | ||
sourcemap: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"inline">]>, z.ZodLiteral<"hidden">]>>; | ||
sourcemapIgnoreList: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodType<SourcemapIgnoreListOption, z.ZodTypeDef, SourcemapIgnoreListOption>]>>; | ||
sourcemapPathTransform: z.ZodOptional<z.ZodType<SourcemapPathTransformOption, z.ZodTypeDef, SourcemapPathTransformOption>>; | ||
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
intro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
outro: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<RenderedChunk, z.ZodTypeDef, RenderedChunk>], z.ZodUnknown>, z.ZodUnion<[z.ZodString, z.ZodPromise<z.ZodString>]>>]>>; | ||
extend: z.ZodOptional<z.ZodBoolean>; | ||
esModule: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"if-default-prop">, z.ZodBoolean]>>; | ||
assetFileNames: z.ZodOptional<z.ZodString>; | ||
entryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
chunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssEntryFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
cssChunkFileNames: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodFunction<z.ZodTuple<[z.ZodType<PreRenderedChunk, z.ZodTypeDef, PreRenderedChunk>], z.ZodUnknown>, z.ZodString>]>>; | ||
minify: z.ZodOptional<z.ZodBoolean>; | ||
name: z.ZodOptional<z.ZodString>; | ||
globals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
externalLiveBindings: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
inlineDynamicImports: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
groups: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
name: z.ZodString; | ||
test: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodType<RegExp, z.ZodTypeDef, RegExp>]>>; | ||
priority: z.ZodOptional<z.ZodNumber>; | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}, { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}>, "many">>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
import { SourcemapIgnoreListOption, SourcemapPathTransformOption } from '../rollup'; | ||
import { RolldownOutputPluginOption } from '../plugin'; | ||
export type ModuleFormat = 'es' | 'cjs' | 'esm' | 'module' | 'commonjs' | 'iife' | 'umd'; | ||
export type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>; | ||
export type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string; | ||
export type GlobalsFunction = (name: string) => string; | ||
export interface OutputOptions { | ||
dir?: string; | ||
file?: string; | ||
exports?: 'auto' | 'named' | 'default' | 'none'; | ||
hashCharacters?: 'base64' | 'base36' | 'hex'; | ||
/** | ||
* Expected format of generated code. | ||
* - `'es'`, `'esm'` and `'module'` are the same format, all stand for ES module. | ||
* - `'cjs'` and `'commonjs'` are the same format, all stand for CommonJS module. | ||
* - `'iife'` stands for [Immediately Invoked Function Expression](https://developer.mozilla.org/en-US/docs/Glossary/IIFE). | ||
* - `'umd'` stands for [Universal Module Definition](https://github.com/umdjs/umd). | ||
* | ||
* @default 'esm' | ||
*/ | ||
format?: ModuleFormat; | ||
sourcemap?: boolean | 'inline' | 'hidden'; | ||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption; | ||
sourcemapPathTransform?: SourcemapPathTransformOption; | ||
banner?: string | AddonFunction; | ||
footer?: string | AddonFunction; | ||
intro?: string | AddonFunction; | ||
outro?: string | AddonFunction; | ||
extend?: boolean; | ||
esModule?: boolean | 'if-default-prop'; | ||
assetFileNames?: string; | ||
entryFileNames?: string | ChunkFileNamesFunction; | ||
chunkFileNames?: string | ChunkFileNamesFunction; | ||
cssEntryFileNames?: string | ChunkFileNamesFunction; | ||
cssChunkFileNames?: string | ChunkFileNamesFunction; | ||
minify?: boolean; | ||
name?: string; | ||
globals?: Record<string, string> | GlobalsFunction; | ||
externalLiveBindings?: boolean; | ||
inlineDynamicImports?: boolean; | ||
advancedChunks?: { | ||
minSize?: number; | ||
minShareCount?: number; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
groups?: { | ||
name: string; | ||
test?: string | RegExp | undefined; | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
priority?: number | undefined; | ||
}[] | undefined; | ||
}>>; | ||
comments: z.ZodOptional<z.ZodEnum<["none", "preserve-legal"]>>; | ||
}, { | ||
banner: z.ZodOptional<z.ZodString>; | ||
footer: z.ZodOptional<z.ZodString>; | ||
intro: z.ZodOptional<z.ZodString>; | ||
outro: z.ZodOptional<z.ZodString>; | ||
esModule: z.ZodOptional<z.ZodBoolean>; | ||
advancedChunks: z.ZodOptional<z.ZodObject<{ | ||
minSize: z.ZodOptional<z.ZodNumber>; | ||
minShareCount: z.ZodOptional<z.ZodNumber>; | ||
}, "strict", z.ZodTypeAny, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}, { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
}>>; | ||
}>, "sourcemapIgnoreList" | "sourcemapPathTransform">, "strict", z.ZodTypeAny, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
test?: StringOrRegExp; | ||
priority?: number; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}[]; | ||
}; | ||
/** | ||
* Control comments in the output. | ||
* | ||
* - `none`: no comments | ||
* - `preserve-legal`: preserve comments that contain `@license`, `@preserve` or starts with `//!` `/*!` | ||
*/ | ||
comments?: 'none' | 'preserve-legal'; | ||
plugins?: RolldownOutputPluginOption; | ||
} | ||
interface OverwriteOutputOptionsForCli { | ||
banner?: string; | ||
footer?: string; | ||
intro?: string; | ||
outro?: string; | ||
esModule?: boolean; | ||
globals?: Record<string, string>; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}, { | ||
footer?: string | undefined; | ||
banner?: string | undefined; | ||
intro?: string | undefined; | ||
outro?: string | undefined; | ||
file?: string | undefined; | ||
name?: string | undefined; | ||
exports?: "auto" | "named" | "default" | "none" | undefined; | ||
esModule?: boolean | undefined; | ||
advancedChunks?: { | ||
minSize?: number | undefined; | ||
minShareCount?: number | undefined; | ||
} | undefined; | ||
dir?: string | undefined; | ||
hashCharacters?: "base64" | "base36" | "hex" | undefined; | ||
format?: "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd" | undefined; | ||
sourcemap?: boolean | "inline" | "hidden" | undefined; | ||
extend?: boolean | undefined; | ||
assetFileNames?: string | undefined; | ||
entryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
chunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssEntryFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
cssChunkFileNames?: string | ((args_0: PreRenderedChunk, ...args: unknown[]) => string) | undefined; | ||
minify?: boolean | undefined; | ||
globals?: Record<string, string> | undefined; | ||
externalLiveBindings?: boolean | undefined; | ||
inlineDynamicImports?: boolean | undefined; | ||
comments?: "none" | "preserve-legal" | undefined; | ||
}>; | ||
minSize?: number; | ||
minShareCount?: number; | ||
}; | ||
} | ||
export type OutputCliOptions = Omit<OutputOptions, keyof OverwriteOutputOptionsForCli | 'sourcemapIgnoreList' | 'sourcemapPathTransform'> & OverwriteOutputOptionsForCli; | ||
export {}; |
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 { hookFilterExtension } from './index'; | ||
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'], hookFilterExtension<'transform'>>; | ||
export declare function bindingifyResolveDynamicImport(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['resolveDynamicImport']>; | ||
export declare function bindingifyTransform(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['transform']>; | ||
export declare function bindingifyLoad(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['load']>; | ||
export declare function bindingifyModuleParsed(args: BindingifyPluginArgs): PluginHookWithBindingExt<BindingPluginOptions['moduleParsed']>; |
@@ -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']>; |
@@ -12,5 +12,5 @@ import type { BindingHookResolveIdExtraArgs, BindingTransformHookExtraArgs, RenderedChunk } from '../binding'; | ||
import type { RollupLog } from '../rollup'; | ||
import type { MinimalPluginContext } from '../log/logger'; | ||
import type { MinimalPluginContext } from './minimal-plugin-context'; | ||
import { InputOptions, OutputOptions } from '..'; | ||
import { BuiltinPlugin } from './builtin-plugin'; | ||
import { BuiltinPlugin } from '../builtin-plugin/constructors'; | ||
import { ParallelPlugin } from './parallel-plugin'; | ||
@@ -124,3 +124,5 @@ import type { DefinedHookNames } from '../constants/plugin'; | ||
export type RolldownPluginOption<A = any> = NullValue<RolldownPlugin<A>> | false; | ||
export type RolldownOutputPlugin = OutputPlugin | BuiltinPlugin; | ||
export type RolldownOutputPluginOption = NullValue<RolldownOutputPlugin> | false | RolldownOutputPluginOption[]; | ||
export type RolldownPluginRec<A = any> = RolldownPluginOption<A> | RolldownPluginOption<A>[]; | ||
export {}; |
@@ -9,3 +9,3 @@ import { BindingPluginContext } from '../binding'; | ||
updateModuleOption(id: string, option: ModuleOptions): void; | ||
getModuleOption(id: string): ModuleOptions | undefined; | ||
getModuleOption(id: string): ModuleOptions; | ||
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null; | ||
@@ -12,0 +12,0 @@ getModuleIds(context: BindingPluginContext): ArrayIterator<string>; |
import type { BindingPluginContext } from '../binding'; | ||
import type { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index'; | ||
import { MinimalPluginContext } from '../log/logger'; | ||
import { MinimalPluginContext } from '../plugin/minimal-plugin-context'; | ||
import { AssetSource } from '../utils/asset-source'; | ||
@@ -10,2 +9,3 @@ import { ModuleInfo } from '../types/module-info'; | ||
import { PartialNull } from '../types/utils'; | ||
import type { LogHandler, LogLevelOption } from '../rollup'; | ||
export interface EmittedAsset { | ||
@@ -41,3 +41,3 @@ type: 'asset'; | ||
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); | ||
} |
import { Plugin, RolldownPluginRec } from './'; | ||
import { NormalizedInputOptions } from '../options/normalized-input-options'; | ||
import { InputOptions, OutputOptions } 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 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'; | ||
@@ -12,3 +11,3 @@ export declare class TransformPluginContext extends PluginContext { | ||
}) => never; | ||
constructor(options: NormalizedInputOptions, context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string); | ||
constructor(context: BindingPluginContext, plugin: Plugin, data: PluginContextData, inner: BindingTransformPluginContext, moduleId: string, moduleSource: string, onLog: LogHandler, LogLevelOption: LogLevelOption); | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { InputOptions } from './types/input-options'; | ||
import type { OutputOptions } from './types/output-options'; | ||
import type { InputOptions } from './options/input-options'; | ||
import type { OutputOptions } from './options/output-options'; | ||
import type { RolldownOutput } from './types/rolldown-output'; | ||
@@ -4,0 +4,0 @@ export declare class RolldownBuild { |
@@ -1,5 +0,5 @@ | ||
import type { InputOptions } from './types/input-options'; | ||
import type { InputOptions } from './options/input-options'; | ||
import { RolldownBuild } from './rolldown-build'; | ||
import { Watcher } from './watcher'; | ||
import { WatchOptions } from './options/watch-option'; | ||
import { WatchOptions } from './options/watch-options'; | ||
export declare const rolldown: (input: InputOptions) => Promise<RolldownBuild>; | ||
@@ -6,0 +6,0 @@ export declare const watch: (input: WatchOptions) => Promise<Watcher>; |
@@ -1,5 +0,1 @@ | ||
import { ModuleSideEffectsRule } from './module-side-effects'; | ||
export interface NormalizedTreeshakingOptions { | ||
moduleSideEffects: boolean | ModuleSideEffectsRule[]; | ||
} | ||
export * from './module-side-effects'; |
@@ -9,18 +9,17 @@ import { z } from 'zod'; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>; | ||
export type ModuleSideEffectsRule = z.infer<typeof ModuleSideEffectsRuleSchema>; | ||
export declare const ModuleSideEffectsOptionSchema: z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
@@ -32,16 +31,16 @@ test: z.ZodOptional<z.ZodType<RegExp, z.ZodTypeDef, RegExp>>; | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>; | ||
@@ -55,17 +54,18 @@ export declare const TreeshakingOptionsSchema: z.ZodUnion<[z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
@@ -78,17 +78,18 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
@@ -101,18 +102,19 @@ moduleSideEffects: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodEffects<z.ZodObject<{ | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}, { | ||
sideEffects: boolean; | ||
external?: boolean | undefined; | ||
test?: RegExp | undefined; | ||
external?: boolean | undefined; | ||
}>, "many">]>, z.ZodLiteral<"no-external">]>>; | ||
annotations: z.ZodOptional<z.ZodBoolean>; | ||
}, z.ZodTypeAny, "passthrough">>, z.ZodBoolean]>; | ||
export type TreeshakingOptions = z.infer<typeof TreeshakingOptionsSchema>; |
@@ -1,5 +0,5 @@ | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export interface RolldownOptions extends InputOptions { | ||
output?: OutputOptions; | ||
} |
import { Bundler } from '../binding'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { OutputOptions } from '../types/output-options'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export declare function createBundler(inputOptions: InputOptions, outputOptions: OutputOptions): Promise<BundlerWithStopWorker>; | ||
@@ -5,0 +5,0 @@ export interface BundlerWithStopWorker { |
@@ -1,8 +0,8 @@ | ||
import type { OutputOptions, OutputPlugin } from '../rollup-types'; | ||
import type { InputOptions } from '../types/input-options'; | ||
import type { RolldownPlugin } from '../plugin'; | ||
import type { RolldownPlugin, RolldownOutputPlugin } from '../plugin'; | ||
import type { InputOptions } from '../options/input-options'; | ||
import type { OutputOptions } from '../options/output-options'; | ||
export declare const normalizePluginOption: { | ||
(plugins: InputOptions['plugins']): Promise<RolldownPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<OutputPlugin[]>; | ||
(plugins: OutputOptions['plugins']): Promise<RolldownOutputPlugin[]>; | ||
(plugins: unknown): Promise<any[]>; | ||
}; |
@@ -8,2 +8,3 @@ import { BindingWatcher } from './binding'; | ||
stopWorkers?: () => Promise<void>; | ||
listeners: Map<WatcherEvent, Array<(...parameters: any[]) => MaybePromise<void>>>; | ||
constructor(inner: BindingWatcher, stopWorkers?: () => Promise<void>); | ||
@@ -32,5 +33,3 @@ close(): Promise<void>; | ||
code: 'ERROR'; | ||
error: { | ||
message: string; | ||
}; | ||
error: Error; | ||
}; |
{ | ||
"name": "rolldown", | ||
"version": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"version": "0.14.0-snapshot-11a6693-20241126041222", | ||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.", | ||
@@ -108,17 +108,17 @@ "homepage": "https://rolldown.rs/", | ||
"@rolldown/testing": "0.0.1", | ||
"rolldown": "0.14.0-snapshot-0e16a9a-20241119003440" | ||
"rolldown": "0.14.0-snapshot-11a6693-20241126041222" | ||
}, | ||
"optionalDependencies": { | ||
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-0e16a9a-20241119003440", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-0e16a9a-20241119003440" | ||
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-11a6693-20241126041222", | ||
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-11a6693-20241126041222" | ||
}, | ||
@@ -125,0 +125,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
107
1
718367
18055