rollup
- Version 4.29.0
- Published
- 2.61 MB
- 1 dependency
- MIT license
Install
npm i rollup
yarn add rollup
pnpm add rollup
Overview
Next-generation ES module bundler
Index
Variables
Functions
Interfaces
NormalizedOutputOptions
- amd
- assetFileNames
- banner
- chunkFileNames
- compact
- dir
- dynamicImportInCjs
- entryFileNames
- esModule
- experimentalMinChunkSize
- exports
- extend
- externalImportAssertions
- externalImportAttributes
- externalLiveBindings
- file
- footer
- format
- freeze
- generatedCode
- globals
- hashCharacters
- hoistTransitiveImports
- importAttributesKey
- indent
- inlineDynamicImports
- interop
- intro
- manualChunks
- minifyInternalExports
- name
- noConflict
- outro
- paths
- plugins
- preserveModules
- preserveModulesRoot
- reexportProtoFromExternal
- sanitizeFileName
- sourcemap
- sourcemapBaseUrl
- sourcemapDebugIds
- sourcemapExcludeSources
- sourcemapFile
- sourcemapFileNames
- sourcemapIgnoreList
- sourcemapPathTransform
- strict
- systemNullSetters
- validate
- virtualDirname
OutputOptions
- amd
- assetFileNames
- banner
- chunkFileNames
- compact
- dir
- dynamicImportInCjs
- entryFileNames
- esModule
- experimentalMinChunkSize
- exports
- extend
- externalImportAssertions
- externalImportAttributes
- externalLiveBindings
- file
- footer
- format
- freeze
- generatedCode
- globals
- hashCharacters
- hoistTransitiveImports
- importAttributesKey
- indent
- inlineDynamicImports
- interop
- intro
- manualChunks
- minifyInternalExports
- name
- noConflict
- outro
- paths
- plugins
- preserveModules
- preserveModulesRoot
- reexportProtoFromExternal
- sanitizeFileName
- sourcemap
- sourcemapBaseUrl
- sourcemapDebugIds
- sourcemapExcludeSources
- sourcemapFile
- sourcemapFileNames
- sourcemapIgnoreList
- sourcemapPathTransform
- strict
- systemNullSetters
- validate
- virtualDirname
Type Aliases
- AddonFunction
- AddonHook
- AddonHookFunction
- AddonHooks
- AmdOptions
- AstNode
- AsyncPluginHooks
- AwaitedEventListener
- ChangeEvent
- CustomPluginOptions
- DecodedSourceMapOrMissing
- EmitFile
- EmittedFile
- ExternalOption
- FirstPluginHooks
- GeneratedCodePreset
- GetInterop
- GetManualChunk
- GetModuleInfo
- GlobalsOption
- HashCharacters
- HasModuleSideEffects
- ImportAttributesKey
- InputOption
- InputPluginHooks
- InputPluginOption
- InternalModuleFormat
- InteropType
- IsExternal
- JsxOptions
- JsxPreset
- LoadHook
- LoadResult
- LoggingFunction
- LoggingFunctionWithPosition
- LogHandler
- LogHandlerWithDefault
- LogLevel
- LogLevelOption
- LogOrStringHandler
- MakeAsync
- ManualChunksOption
- MaybeArray
- MaybePromise
- ModuleFormat
- ModuleParsedHook
- ModuleSideEffectsOption
- NormalizedAmdOptions
- NormalizedJsxOptions
- NullValue
- ObjectHook
- OmittedEstreeKeys
- OptionsPaths
- OutputBundle
- OutputPluginHooks
- OutputPluginOption
- ParallelPluginHooks
- ParseAst
- ParseAstAsync
- PartialNull
- PluginHooks
- PluginImpl
- PreserveEntrySignaturesOption
- ProgramNode
- RenderChunkHook
- ResolvedIdMap
- ResolveDynamicImportHook
- ResolveFileUrlHook
- ResolveIdHook
- ResolveIdResult
- ResolveIdResultWithoutNullValue
- ResolveImportMetaHook
- RollupAstNode
- RollupOptionsFunction
- RollupWatcher
- RollupWatcherEvent
- RollupWatchHooks
- SequentialPluginHooks
- SerializablePluginCache
- SerializedTimings
- ShouldTransformCachedModuleHook
- SourcemapIgnoreListOption
- SourceMapInput
- SourcemapPathTransformOption
- SourceMapSegment
- SyncPluginHooks
- TransformHook
- TransformResult
- TreeshakingPreset
- WarningHandlerWithDefault
- WatchChangeHook
Namespaces
Variables
variable VERSION
const VERSION: string;
Functions
function defineConfig
defineConfig: { (options: RollupOptions): RollupOptions; (options: RollupOptions[]): RollupOptions[]; (optionsFunction: RollupOptionsFunction): RollupOptionsFunction;};
function rollup
rollup: (options: RollupOptions) => Promise<RollupBuild>;
function watch
watch: (config: RollupWatchOptions | RollupWatchOptions[]) => RollupWatcher;
Interfaces
interface AstNodeLocation
interface AstNodeLocation {}
interface AwaitingEventEmitter
interface AwaitingEventEmitter< T extends Record<string, (...parameters: any) => any>> {}
method close
close: () => Promise<void>;
method emit
emit: <K extends keyof T>( event: K, ...parameters: Parameters<T[K]>) => Promise<unknown>;
method off
off: <K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>) => this;
Removes an event listener.
method on
on: <K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>) => this;
Registers an event listener that will be awaited before Rollup continues. All listeners will be awaited in parallel while rejections are tracked via Promise.all.
method onCurrentRun
onCurrentRun: <K extends keyof T>( event: K, listener: (...parameters: Parameters<T[K]>) => Promise<ReturnType<T[K]>>) => this;
Registers an event listener that will be awaited before Rollup continues. All listeners will be awaited in parallel while rejections are tracked via Promise.all. Listeners are removed automatically when removeListenersForCurrentRun is called, which happens automatically after each run.
method removeAllListeners
removeAllListeners: () => this;
method removeListenersForCurrentRun
removeListenersForCurrentRun: () => this;
interface ChokidarOptions
interface ChokidarOptions {}
property alwaysStat
alwaysStat?: boolean;
property atomic
atomic?: boolean | number;
property awaitWriteFinish
awaitWriteFinish?: | { pollInterval?: number; stabilityThreshold?: number; } | boolean;
property binaryInterval
binaryInterval?: number;
property cwd
cwd?: string;
property depth
depth?: number;
property disableGlobbing
disableGlobbing?: boolean;
property followSymlinks
followSymlinks?: boolean;
property ignored
ignored?: any;
property ignoreInitial
ignoreInitial?: boolean;
property ignorePermissionErrors
ignorePermissionErrors?: boolean;
property interval
interval?: number;
property persistent
persistent?: boolean;
property useFsEvents
useFsEvents?: boolean;
property usePolling
usePolling?: boolean;
interface EmittedAsset
interface EmittedAsset {}
property fileName
fileName?: string;
property name
name?: string;
property needsCodeReference
needsCodeReference?: boolean;
property originalFileName
originalFileName?: string | null;
property source
source?: string | Uint8Array;
property type
type: 'asset';
interface EmittedChunk
interface EmittedChunk {}
property fileName
fileName?: string;
property id
id: string;
property implicitlyLoadedAfterOneOf
implicitlyLoadedAfterOneOf?: string[];
property importer
importer?: string;
property name
name?: string;
property preserveSignature
preserveSignature?: PreserveEntrySignaturesOption;
property type
type: 'chunk';
interface EmittedPrebuiltChunk
interface EmittedPrebuiltChunk {}
interface ExistingDecodedSourceMap
interface ExistingDecodedSourceMap {}
property file
file?: string;
property mappings
readonly mappings: SourceMapSegment[][];
property names
names: string[];
property sourceRoot
sourceRoot?: string;
property sources
sources: string[];
property sourcesContent
sourcesContent?: string[];
property version
version: number;
property x_google_ignoreList
x_google_ignoreList?: number[];
interface ExistingRawSourceMap
interface ExistingRawSourceMap {}
property file
file?: string;
property mappings
mappings: string;
property names
names: string[];
property sourceRoot
sourceRoot?: string;
property sources
sources: string[];
property sourcesContent
sourcesContent?: string[];
property version
version: number;
property x_google_ignoreList
x_google_ignoreList?: number[];
interface FunctionPluginHooks
interface FunctionPluginHooks {}
property augmentChunkHash
augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
property buildEnd
buildEnd: (this: PluginContext, error?: Error) => void;
property buildStart
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
property closeBundle
closeBundle: (this: PluginContext) => void;
property closeWatcher
closeWatcher: (this: PluginContext) => void;
property generateBundle
generateBundle: ( this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle, isWrite: boolean) => void;
property load
load: LoadHook;
property moduleParsed
moduleParsed: ModuleParsedHook;
property onLog
onLog: ( this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
property options
options: ( this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
property outputOptions
outputOptions: ( this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
property renderChunk
renderChunk: RenderChunkHook;
property renderDynamicImport
renderDynamicImport: ( this: PluginContext, options: { customResolution: string | null; format: InternalModuleFormat; moduleId: string; targetModuleId: string | null; }) => { left: string; right: string } | NullValue;
property renderError
renderError: (this: PluginContext, error?: Error) => void;
property renderStart
renderStart: ( this: PluginContext, outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions) => void;
property resolveDynamicImport
resolveDynamicImport: ResolveDynamicImportHook;
property resolveFileUrl
resolveFileUrl: ResolveFileUrlHook;
property resolveId
resolveId: ResolveIdHook;
property resolveImportMeta
resolveImportMeta: ResolveImportMetaHook;
property shouldTransformCachedModule
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
property transform
transform: TransformHook;
property watchChange
watchChange: WatchChangeHook;
property writeBundle
writeBundle: ( this: PluginContext, options: NormalizedOutputOptions, bundle: OutputBundle) => void;
interface GeneratedCodeOptions
interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {}
property preset
preset?: GeneratedCodePreset;
interface InputOptions
interface InputOptions {}
property cache
cache?: boolean | RollupCache;
property context
context?: string;
property experimentalCacheExpiry
experimentalCacheExpiry?: number;
property experimentalLogSideEffects
experimentalLogSideEffects?: boolean;
property external
external?: ExternalOption;
property input
input?: InputOption;
property jsx
jsx?: false | JsxPreset | JsxOptions;
property logLevel
logLevel?: LogLevelOption;
property makeAbsoluteExternalsRelative
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
property maxParallelFileOps
maxParallelFileOps?: number;
property moduleContext
moduleContext?: ((id: string) => string | NullValue) | Record<string, string>;
property onLog
onLog?: LogHandlerWithDefault;
property onwarn
onwarn?: WarningHandlerWithDefault;
property perf
perf?: boolean;
property plugins
plugins?: InputPluginOption;
property preserveEntrySignatures
preserveEntrySignatures?: PreserveEntrySignaturesOption;
property preserveSymlinks
preserveSymlinks?: boolean;
property shimMissingExports
shimMissingExports?: boolean;
property strictDeprecations
strictDeprecations?: boolean;
property treeshake
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
property watch
watch?: WatcherOptions | false;
interface InputOptionsWithPlugins
interface InputOptionsWithPlugins extends InputOptions {}
property plugins
plugins: Plugin[];
interface ManualChunkMeta
interface ManualChunkMeta {}
property getModuleIds
getModuleIds: () => IterableIterator<string>;
property getModuleInfo
getModuleInfo: GetModuleInfo;
interface MergedRollupOptions
interface MergedRollupOptions extends InputOptionsWithPlugins {}
property output
output: OutputOptions[];
interface MinimalPluginContext
interface MinimalPluginContext {}
interface ModuleInfo
interface ModuleInfo extends ModuleOptions {}
property ast
ast: ProgramNode | null;
property code
code: string | null;
property dynamicallyImportedIdResolutions
dynamicallyImportedIdResolutions: readonly ResolvedId[];
property dynamicallyImportedIds
dynamicallyImportedIds: readonly string[];
property dynamicImporters
dynamicImporters: readonly string[];
property exportedBindings
exportedBindings: Record<string, string[]> | null;
property exports
exports: string[] | null;
property hasDefaultExport
hasDefaultExport: boolean | null;
property id
id: string;
property implicitlyLoadedAfterOneOf
implicitlyLoadedAfterOneOf: readonly string[];
property implicitlyLoadedBefore
implicitlyLoadedBefore: readonly string[];
property importedIdResolutions
importedIdResolutions: readonly ResolvedId[];
property importedIds
importedIds: readonly string[];
property importers
importers: readonly string[];
property isEntry
isEntry: boolean;
property isExternal
isExternal: boolean;
property isIncluded
isIncluded: boolean | null;
interface ModuleJSON
interface ModuleJSON extends TransformModuleJSON, ModuleOptions {}
property ast
ast: ProgramNode;
property dependencies
dependencies: string[];
property id
id: string;
property resolvedIds
resolvedIds: ResolvedIdMap;
property transformFiles
transformFiles: EmittedFile[] | undefined;
interface ModuleOptions
interface ModuleOptions {}
property attributes
attributes: Record<string, string>;
property meta
meta: CustomPluginOptions;
property moduleSideEffects
moduleSideEffects: boolean | 'no-treeshake';
property syntheticNamedExports
syntheticNamedExports: boolean | string;
interface NormalizedGeneratedCodeOptions
interface NormalizedGeneratedCodeOptions {}
property arrowFunctions
arrowFunctions: boolean;
property constBindings
constBindings: boolean;
property objectShorthand
objectShorthand: boolean;
property reservedNamesAsProps
reservedNamesAsProps: boolean;
property symbols
symbols: boolean;
interface NormalizedInputOptions
interface NormalizedInputOptions {}
property cache
cache: false | undefined | RollupCache;
property context
context: string;
property experimentalCacheExpiry
experimentalCacheExpiry: number;
property experimentalLogSideEffects
experimentalLogSideEffects: boolean;
property external
external: IsExternal;
property input
input: string[] | Record<string, string>;
property jsx
jsx: false | NormalizedJsxOptions;
property logLevel
logLevel: LogLevelOption;
property makeAbsoluteExternalsRelative
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
property maxParallelFileOps
maxParallelFileOps: number;
property moduleContext
moduleContext: (id: string) => string;
property onLog
onLog: LogHandler;
property perf
perf: boolean;
property plugins
plugins: Plugin[];
property preserveEntrySignatures
preserveEntrySignatures: PreserveEntrySignaturesOption;
property preserveSymlinks
preserveSymlinks: boolean;
property shimMissingExports
shimMissingExports: boolean;
property strictDeprecations
strictDeprecations: boolean;
property treeshake
treeshake: false | NormalizedTreeshakingOptions;
interface NormalizedJsxAutomaticOptions
interface NormalizedJsxAutomaticOptions {}
property factory
factory: string;
property importSource
importSource: string | null;
property jsxImportSource
jsxImportSource: string;
property mode
mode: 'automatic';
interface NormalizedJsxClassicOptions
interface NormalizedJsxClassicOptions {}
property factory
factory: string;
property fragment
fragment: string;
property importSource
importSource: string | null;
property mode
mode: 'classic';
interface NormalizedJsxPreserveOptions
interface NormalizedJsxPreserveOptions {}
property factory
factory: string | null;
property fragment
fragment: string | null;
property importSource
importSource: string | null;
property mode
mode: 'preserve';
interface NormalizedOutputOptions
interface NormalizedOutputOptions {}
property amd
amd: NormalizedAmdOptions;
property assetFileNames
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
property banner
banner: AddonFunction;
property chunkFileNames
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
property compact
compact: boolean;
property dir
dir: string | undefined;
property dynamicImportInCjs
dynamicImportInCjs: boolean;
property entryFileNames
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
property esModule
esModule: boolean | 'if-default-prop';
property experimentalMinChunkSize
experimentalMinChunkSize: number;
property exports
exports: 'default' | 'named' | 'none' | 'auto';
property extend
extend: boolean;
property externalImportAssertions
externalImportAssertions: boolean;
Deprecated
Use "externalImportAttributes" instead.
property externalImportAttributes
externalImportAttributes: boolean;
property externalLiveBindings
externalLiveBindings: boolean;
property file
file: string | undefined;
property footer
footer: AddonFunction;
property format
format: InternalModuleFormat;
property freeze
freeze: boolean;
property generatedCode
generatedCode: NormalizedGeneratedCodeOptions;
property globals
globals: GlobalsOption;
property hashCharacters
hashCharacters: HashCharacters;
property hoistTransitiveImports
hoistTransitiveImports: boolean;
property importAttributesKey
importAttributesKey: ImportAttributesKey;
property indent
indent: true | string;
property inlineDynamicImports
inlineDynamicImports: boolean;
property interop
interop: GetInterop;
property intro
intro: AddonFunction;
property manualChunks
manualChunks: ManualChunksOption;
property minifyInternalExports
minifyInternalExports: boolean;
property name
name: string | undefined;
property noConflict
noConflict: boolean;
property outro
outro: AddonFunction;
property paths
paths: OptionsPaths;
property plugins
plugins: OutputPlugin[];
property preserveModules
preserveModules: boolean;
property preserveModulesRoot
preserveModulesRoot: string | undefined;
property reexportProtoFromExternal
reexportProtoFromExternal: boolean;
property sanitizeFileName
sanitizeFileName: (fileName: string) => string;
property sourcemap
sourcemap: boolean | 'inline' | 'hidden';
property sourcemapBaseUrl
sourcemapBaseUrl: string | undefined;
property sourcemapDebugIds
sourcemapDebugIds: boolean;
property sourcemapExcludeSources
sourcemapExcludeSources: boolean;
property sourcemapFile
sourcemapFile: string | undefined;
property sourcemapFileNames
sourcemapFileNames: | string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
property sourcemapIgnoreList
sourcemapIgnoreList: SourcemapIgnoreListOption;
property sourcemapPathTransform
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
property strict
strict: boolean;
property systemNullSetters
systemNullSetters: boolean;
property validate
validate: boolean;
property virtualDirname
virtualDirname: string;
interface NormalizedTreeshakingOptions
interface NormalizedTreeshakingOptions {}
property annotations
annotations: boolean;
property correctVarValueBeforeDeclaration
correctVarValueBeforeDeclaration: boolean;
property manualPureFunctions
manualPureFunctions: readonly string[];
property moduleSideEffects
moduleSideEffects: HasModuleSideEffects;
property propertyReadSideEffects
propertyReadSideEffects: boolean | 'always';
property tryCatchDeoptimization
tryCatchDeoptimization: boolean;
property unknownGlobalSideEffects
unknownGlobalSideEffects: boolean;
interface OutputAsset
interface OutputAsset extends PreRenderedAsset {}
property fileName
fileName: string;
property needsCodeReference
needsCodeReference: boolean;
interface OutputChunk
interface OutputChunk extends RenderedChunk {}
property code
code: string;
property map
map: SourceMap | null;
property preliminaryFileName
preliminaryFileName: string;
property sourcemapFileName
sourcemapFileName: string | null;
interface OutputOptions
interface OutputOptions {}
property amd
amd?: AmdOptions;
property assetFileNames
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
property banner
banner?: string | AddonFunction;
property chunkFileNames
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
property compact
compact?: boolean;
property dir
dir?: string;
property dynamicImportInCjs
dynamicImportInCjs?: boolean;
property entryFileNames
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
property esModule
esModule?: boolean | 'if-default-prop';
property experimentalMinChunkSize
experimentalMinChunkSize?: number;
property exports
exports?: 'default' | 'named' | 'none' | 'auto';
property extend
extend?: boolean;
property externalImportAssertions
externalImportAssertions?: boolean;
Deprecated
Use "externalImportAttributes" instead.
property externalImportAttributes
externalImportAttributes?: boolean;
property externalLiveBindings
externalLiveBindings?: boolean;
property file
file?: string;
property footer
footer?: string | AddonFunction;
property format
format?: ModuleFormat;
property freeze
freeze?: boolean;
property generatedCode
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
property globals
globals?: GlobalsOption;
property hashCharacters
hashCharacters?: HashCharacters;
property hoistTransitiveImports
hoistTransitiveImports?: boolean;
property importAttributesKey
importAttributesKey?: ImportAttributesKey;
property indent
indent?: string | boolean;
property inlineDynamicImports
inlineDynamicImports?: boolean;
property interop
interop?: InteropType | GetInterop;
property intro
intro?: string | AddonFunction;
property manualChunks
manualChunks?: ManualChunksOption;
property minifyInternalExports
minifyInternalExports?: boolean;
property name
name?: string;
property noConflict
noConflict?: boolean;
property outro
outro?: string | AddonFunction;
property paths
paths?: OptionsPaths;
property plugins
plugins?: OutputPluginOption;
property preserveModules
preserveModules?: boolean;
property preserveModulesRoot
preserveModulesRoot?: string;
property reexportProtoFromExternal
reexportProtoFromExternal?: boolean;
property sanitizeFileName
sanitizeFileName?: boolean | ((fileName: string) => string);
property sourcemap
sourcemap?: boolean | 'inline' | 'hidden';
property sourcemapBaseUrl
sourcemapBaseUrl?: string;
property sourcemapDebugIds
sourcemapDebugIds?: boolean;
property sourcemapExcludeSources
sourcemapExcludeSources?: boolean;
property sourcemapFile
sourcemapFile?: string;
property sourcemapFileNames
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
property sourcemapIgnoreList
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
property sourcemapPathTransform
sourcemapPathTransform?: SourcemapPathTransformOption;
property strict
strict?: boolean;
property systemNullSetters
systemNullSetters?: boolean;
property validate
validate?: boolean;
property virtualDirname
virtualDirname?: string;
interface OutputPlugin
interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {}
interface PartialResolvedId
interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {}
property external
external?: boolean | 'absolute' | 'relative';
property id
id: string;
property resolvedBy
resolvedBy?: string;
interface Plugin
interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {}
property api
api?: A;
interface PluginCache
interface PluginCache {}
interface PluginContext
interface PluginContext extends MinimalPluginContext {}
property addWatchFile
addWatchFile: (id: string) => void;
property cache
cache: PluginCache;
property debug
debug: LoggingFunction;
property emitFile
emitFile: EmitFile;
property error
error: (error: RollupError | string) => never;
property getFileName
getFileName: (fileReferenceId: string) => string;
property getModuleIds
getModuleIds: () => IterableIterator<string>;
property getModuleInfo
getModuleInfo: GetModuleInfo;
property getWatchFiles
getWatchFiles: () => string[];
property info
info: LoggingFunction;
property load
load: ( options: { id: string; resolveDependencies?: boolean } & Partial< PartialNull<ModuleOptions> >) => Promise<ModuleInfo>;
property parse
parse: ParseAst;
property resolve
resolve: ( source: string, importer?: string, options?: { attributes?: Record<string, string>; custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean; }) => Promise<ResolvedId | null>;
property setAssetSource
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
property warn
warn: LoggingFunction;
interface PluginContextMeta
interface PluginContextMeta {}
property rollupVersion
rollupVersion: string;
property watchMode
watchMode: boolean;
interface PreRenderedAsset
interface PreRenderedAsset {}
property name
name: string | undefined;
Deprecated
Use "names" instead.
property names
names: string[];
property originalFileName
originalFileName: string | null;
Deprecated
Use "originalFileNames" instead.
property originalFileNames
originalFileNames: string[];
property source
source: string | Uint8Array;
property type
type: 'asset';
interface PreRenderedChunk
interface PreRenderedChunk {}
property exports
exports: string[];
property facadeModuleId
facadeModuleId: string | null;
property isDynamicEntry
isDynamicEntry: boolean;
property isEntry
isEntry: boolean;
property isImplicitEntry
isImplicitEntry: boolean;
property moduleIds
moduleIds: string[];
property name
name: string;
property type
type: 'chunk';
interface RenderedChunk
interface RenderedChunk extends PreRenderedChunk {}
property dynamicImports
dynamicImports: string[];
property fileName
fileName: string;
property implicitlyLoadedBefore
implicitlyLoadedBefore: string[];
property importedBindings
importedBindings: Record<string, string[]>;
property imports
imports: string[];
property modules
modules: Record<string, RenderedModule>;
property referencedFiles
referencedFiles: string[];
interface RenderedModule
interface RenderedModule {}
property code
readonly code: string | null;
property originalLength
originalLength: number;
property removedExports
removedExports: string[];
property renderedExports
renderedExports: string[];
property renderedLength
renderedLength: number;
interface ResolvedId
interface ResolvedId extends ModuleOptions {}
property external
external: boolean | 'absolute';
property id
id: string;
property resolvedBy
resolvedBy: string;
interface RollupBuild
interface RollupBuild {}
property cache
cache: RollupCache | undefined;
property close
close: () => Promise<void>;
property closed
closed: boolean;
property generate
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
property getTimings
getTimings?: () => SerializedTimings;
property watchFiles
watchFiles: string[];
property write
write: (options: OutputOptions) => Promise<RollupOutput>;
method [Symbol.asyncDispose]
[Symbol.asyncDispose]: () => Promise<void>;
interface RollupCache
interface RollupCache {}
interface RollupError
interface RollupError extends RollupLog {}
interface RollupLog
interface RollupLog {}
property binding
binding?: string;
property cause
cause?: unknown;
property code
code?: string;
property exporter
exporter?: string;
property frame
frame?: string;
property hook
hook?: string;
property id
id?: string;
property ids
ids?: string[];
property loc
loc?: { column: number; file?: string; line: number;};
property message
message: string;
property meta
meta?: any;
property names
names?: string[];
property plugin
plugin?: string;
property pluginCode
pluginCode?: unknown;
property pos
pos?: number;
property reexporter
reexporter?: string;
property stack
stack?: string;
property url
url?: string;
interface RollupOptions
interface RollupOptions extends InputOptions {}
property output
output?: OutputOptions | OutputOptions[];
interface RollupOutput
interface RollupOutput {}
property output
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
interface RollupWatchOptions
interface RollupWatchOptions extends InputOptions {}
interface SourceDescription
interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {}
interface SourceMap
interface SourceMap {}
property debugId
debugId?: string;
property file
file: string;
property mappings
mappings: string;
property names
names: string[];
property sources
sources: string[];
property sourcesContent
sourcesContent?: string[];
property version
version: number;
method toString
toString: () => string;
method toUrl
toUrl: () => string;
interface TransformModuleJSON
interface TransformModuleJSON {}
property ast
ast?: ProgramNode;
property code
code: string;
property customTransformCache
customTransformCache: boolean;
property originalCode
originalCode: string;
property originalSourcemap
originalSourcemap: ExistingDecodedSourceMap | null;
property sourcemapChain
sourcemapChain: DecodedSourceMapOrMissing[];
property transformDependencies
transformDependencies: string[];
interface TransformPluginContext
interface TransformPluginContext extends PluginContext {}
property debug
debug: LoggingFunctionWithPosition;
property error
error: ( error: RollupError | string, pos?: number | { column: number; line: number }) => never;
property getCombinedSourcemap
getCombinedSourcemap: () => SourceMap;
property info
info: LoggingFunctionWithPosition;
property warn
warn: LoggingFunctionWithPosition;
interface TreeshakingOptions
interface TreeshakingOptions extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {}
property moduleSideEffects
moduleSideEffects?: ModuleSideEffectsOption;
property preset
preset?: TreeshakingPreset;
interface WatcherOptions
interface WatcherOptions {}
property buildDelay
buildDelay?: number;
property chokidar
chokidar?: ChokidarOptions;
property clearScreen
clearScreen?: boolean;
property exclude
exclude?: string | RegExp | (string | RegExp)[];
property include
include?: string | RegExp | (string | RegExp)[];
property skipWrite
skipWrite?: boolean;
Type Aliases
type AddonFunction
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
type AddonHook
type AddonHook = string | AddonHookFunction;
type AddonHookFunction
type AddonHookFunction = ( this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
type AddonHooks
type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
type AmdOptions
type AmdOptions = ( | { autoId?: false; id: string; } | { autoId: true; basePath?: string; id?: undefined; } | { autoId?: false; id?: undefined; }) & { define?: string; forceJsExtensionForImports?: boolean;};
type AstNode
type AstNode = RollupAstNode<estree.Node>;
type AsyncPluginHooks
type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
type AwaitedEventListener
type AwaitedEventListener< T extends Record<string, (...parameters: any) => any>, K extends keyof T> = (...parameters: Parameters<T[K]>) => void | Promise<void>;
type ChangeEvent
type ChangeEvent = 'create' | 'update' | 'delete';
type CustomPluginOptions
type CustomPluginOptions = Record<string, any>;
type DecodedSourceMapOrMissing
type DecodedSourceMapOrMissing = | { missing: true; plugin: string; } | (ExistingDecodedSourceMap & { missing?: false });
type EmitFile
type EmitFile = (emittedFile: EmittedFile) => string;
type EmittedFile
type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
type ExternalOption
type ExternalOption = | (string | RegExp)[] | string | RegExp | (( source: string, importer: string | undefined, isResolved: boolean ) => boolean | NullValue);
type FirstPluginHooks
type FirstPluginHooks = | 'load' | 'renderDynamicImport' | 'resolveDynamicImport' | 'resolveFileUrl' | 'resolveId' | 'resolveImportMeta' | 'shouldTransformCachedModule';
type GeneratedCodePreset
type GeneratedCodePreset = 'es5' | 'es2015';
type GetInterop
type GetInterop = (id: string | null) => InteropType;
type GetManualChunk
type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
type GetModuleInfo
type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
type GlobalsOption
type GlobalsOption = Record<string, string> | ((name: string) => string);
type HashCharacters
type HashCharacters = 'base64' | 'base36' | 'hex';
type HasModuleSideEffects
type HasModuleSideEffects = (id: string, external: boolean) => boolean;
type ImportAttributesKey
type ImportAttributesKey = 'with' | 'assert';
type InputOption
type InputOption = string | string[] | Record<string, string>;
type InputPluginHooks
type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
type InputPluginOption
type InputPluginOption = MaybePromise< Plugin | NullValue | false | InputPluginOption[]>;
type InternalModuleFormat
type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
type InteropType
type InteropType = 'compat' | 'auto' | 'esModule' | 'default' | 'defaultOnly';
type IsExternal
type IsExternal = ( source: string, importer: string | undefined, isResolved: boolean) => boolean;
type JsxOptions
type JsxOptions = Partial<NormalizedJsxOptions> & { preset?: JsxPreset;};
type JsxPreset
type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
type LoadHook
type LoadHook = (this: PluginContext, id: string) => LoadResult;
type LoadResult
type LoadResult = SourceDescription | string | NullValue;
type LoggingFunction
type LoggingFunction = ( log: RollupLog | string | (() => RollupLog | string)) => void;
type LoggingFunctionWithPosition
type LoggingFunctionWithPosition = ( log: RollupLog | string | (() => RollupLog | string), pos?: number | { column: number; line: number }) => void;
type LogHandler
type LogHandler = (level: LogLevel, log: RollupLog) => void;
type LogHandlerWithDefault
type LogHandlerWithDefault = ( level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => void;
type LogLevel
type LogLevel = 'warn' | 'info' | 'debug';
type LogLevelOption
type LogLevelOption = LogLevel | 'silent';
type LogOrStringHandler
type LogOrStringHandler = ( level: LogLevel | 'error', log: RollupLog | string) => void;
type MakeAsync
type MakeAsync<Function_> = Function_ extends ( this: infer This, ...parameters: infer Arguments) => infer Return ? (this: This, ...parameters: Arguments) => Return | Promise<Return> : never;
type ManualChunksOption
type ManualChunksOption = Record<string, string[]> | GetManualChunk;
type MaybeArray
type MaybeArray<T> = T | T[];
type MaybePromise
type MaybePromise<T> = T | Promise<T>;
type ModuleFormat
type ModuleFormat = | InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
type ModuleParsedHook
type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
type ModuleSideEffectsOption
type ModuleSideEffectsOption = | boolean | 'no-external' | string[] | HasModuleSideEffects;
type NormalizedAmdOptions
type NormalizedAmdOptions = ( | { autoId: false; id?: string; } | { autoId: true; basePath: string; }) & { define: string; forceJsExtensionForImports: boolean;};
type NormalizedJsxOptions
type NormalizedJsxOptions = | NormalizedJsxPreserveOptions | NormalizedJsxClassicOptions | NormalizedJsxAutomaticOptions;
type NullValue
type NullValue = null | undefined | void;
type ObjectHook
type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
type OmittedEstreeKeys
type OmittedEstreeKeys = | 'loc' | 'range' | 'leadingComments' | 'trailingComments' | 'innerComments' | 'comments';
type OptionsPaths
type OptionsPaths = Record<string, string> | ((id: string) => string);
type OutputBundle
type OutputBundle = Record<string, OutputAsset | OutputChunk>;
type OutputPluginHooks
type OutputPluginHooks = | 'augmentChunkHash' | 'generateBundle' | 'outputOptions' | 'renderChunk' | 'renderDynamicImport' | 'renderError' | 'renderStart' | 'resolveFileUrl' | 'resolveImportMeta' | 'writeBundle';
type OutputPluginOption
type OutputPluginOption = MaybePromise< OutputPlugin | NullValue | false | OutputPluginOption[]>;
type ParallelPluginHooks
type ParallelPluginHooks = Exclude< keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
type ParseAst
type ParseAst = ( input: string, options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }) => ProgramNode;
type ParseAstAsync
type ParseAstAsync = ( input: string, options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; signal?: AbortSignal; }) => Promise<ProgramNode>;
type PartialNull
type PartialNull<T> = { [P in keyof T]: T[P] | null;};
type PluginHooks
type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook< K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], // eslint-disable-next-line @typescript-eslint/no-empty-object-type K extends ParallelPluginHooks ? { sequential?: boolean } : {} >;};
type PluginImpl
type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
use this type for plugin annotation
Example 1
interface Options {...}const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
type PreserveEntrySignaturesOption
type PreserveEntrySignaturesOption = | false | 'strict' | 'allow-extension' | 'exports-only';
type ProgramNode
type ProgramNode = RollupAstNode<estree.Program>;
type RenderChunkHook
type RenderChunkHook = ( this: PluginContext, code: string, chunk: RenderedChunk, options: NormalizedOutputOptions, meta: { chunks: Record<string, RenderedChunk> }) => { code: string; map?: SourceMapInput } | string | NullValue;
type ResolvedIdMap
type ResolvedIdMap = Record<string, ResolvedId>;
type ResolveDynamicImportHook
type ResolveDynamicImportHook = ( this: PluginContext, specifier: string | AstNode, importer: string, options: { attributes: Record<string, string> }) => ResolveIdResult;
type ResolveFileUrlHook
type ResolveFileUrlHook = ( this: PluginContext, options: { chunkId: string; fileName: string; format: InternalModuleFormat; moduleId: string; referenceId: string; relativePath: string; }) => string | NullValue;
type ResolveIdHook
type ResolveIdHook = ( this: PluginContext, source: string, importer: string | undefined, options: { attributes: Record<string, string>; custom?: CustomPluginOptions; isEntry: boolean; }) => ResolveIdResult;
type ResolveIdResult
type ResolveIdResult = string | NullValue | false | PartialResolvedId;
type ResolveIdResultWithoutNullValue
type ResolveIdResultWithoutNullValue = string | false | PartialResolvedId;
type ResolveImportMetaHook
type ResolveImportMetaHook = ( this: PluginContext, property: string | null, options: { chunkId: string; format: InternalModuleFormat; moduleId: string }) => string | NullValue;
type RollupAstNode
type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
type RollupOptionsFunction
type RollupOptionsFunction = ( commandLineArguments: Record<string, any>) => MaybePromise<RollupOptions | RollupOptions[]>;
type RollupWatcher
type RollupWatcher = AwaitingEventEmitter<{ change: (id: string, change: { event: ChangeEvent }) => void; close: () => void; event: (event: RollupWatcherEvent) => void; restart: () => void;}>;
type RollupWatcherEvent
type RollupWatcherEvent = | { code: 'START' } | { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] } | { code: 'BUNDLE_END'; duration: number; input?: InputOption; output: readonly string[]; result: RollupBuild; } | { code: 'END' } | { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
type RollupWatchHooks
type RollupWatchHooks = | 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd';
type SequentialPluginHooks
type SequentialPluginHooks = | 'augmentChunkHash' | 'generateBundle' | 'onLog' | 'options' | 'outputOptions' | 'renderChunk' | 'transform';
type SerializablePluginCache
type SerializablePluginCache = Record<string, [number, any]>;
type SerializedTimings
type SerializedTimings = Record<string, [number, number, number]>;
type ShouldTransformCachedModuleHook
type ShouldTransformCachedModuleHook = ( this: PluginContext, options: { ast: ProgramNode; code: string; id: string; meta: CustomPluginOptions; moduleSideEffects: boolean | 'no-treeshake'; resolvedSources: ResolvedIdMap; syntheticNamedExports: boolean | string; }) => boolean | NullValue;
type SourcemapIgnoreListOption
type SourcemapIgnoreListOption = ( relativeSourcePath: string, sourcemapPath: string) => boolean;
type SourceMapInput
type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
type SourcemapPathTransformOption
type SourcemapPathTransformOption = ( relativeSourcePath: string, sourcemapPath: string) => string;
type SourceMapSegment
type SourceMapSegment = | [number] | [number, number, number, number] | [number, number, number, number, number];
type SyncPluginHooks
type SyncPluginHooks = | 'augmentChunkHash' | 'onLog' | 'outputOptions' | 'renderDynamicImport' | 'resolveFileUrl' | 'resolveImportMeta';
type TransformHook
type TransformHook = ( this: TransformPluginContext, code: string, id: string) => TransformResult;
type TransformResult
type TransformResult = string | NullValue | Partial<SourceDescription>;
type TreeshakingPreset
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
type WarningHandlerWithDefault
type WarningHandlerWithDefault = ( warning: RollupLog, defaultHandler: LoggingFunction) => void;
type WatchChangeHook
type WatchChangeHook = ( this: PluginContext, id: string, change: { event: ChangeEvent }) => void;
Namespaces
namespace global
namespace global {}
interface AbortSignal
interface AbortSignal {}
Package Files (1)
Dependencies (1)
Dev Dependencies (83)
- @codemirror/commands
- @codemirror/lang-javascript
- @codemirror/language
- @codemirror/search
- @codemirror/state
- @codemirror/view
- @eslint/js
- @inquirer/prompts
- @jridgewell/sourcemap-codec
- @mermaid-js/mermaid-cli
- @napi-rs/cli
- @rollup/plugin-alias
- @rollup/plugin-buble
- @rollup/plugin-commonjs
- @rollup/plugin-json
- @rollup/plugin-node-resolve
- @rollup/plugin-replace
- @rollup/plugin-terser
- @rollup/plugin-typescript
- @rollup/pluginutils
- @shikijs/vitepress-twoslash
- @types/mocha
- @types/node
- @types/semver
- @types/yargs-parser
- @vue/language-server
- acorn
- acorn-import-assertions
- acorn-jsx
- buble
- builtin-modules
- chokidar
- colorette
- concurrently
- core-js
- cross-env
- date-time
- es5-shim
- es6-shim
- eslint
- eslint-config-prettier
- eslint-plugin-prettier
- eslint-plugin-unicorn
- eslint-plugin-vue
- fixturify
- flru
- fs-extra
- github-api
- globals
- husky
- is-reference
- lint-staged
- locate-character
- magic-string
- mocha
- nodemon
- npm-audit-resolver
- nyc
- pinia
- prettier
- prettier-plugin-organize-imports
- pretty-bytes
- pretty-ms
- requirejs
- rollup
- rollup-plugin-license
- rollup-plugin-string
- semver
- shx
- signal-exit
- source-map
- source-map-support
- systemjs
- terser
- tslib
- typescript
- typescript-eslint
- vite
- vitepress
- vue
- vue-tsc
- wasm-pack
- yargs-parser
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/rollup
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/rollup)
- HTML<a href="https://www.jsdocs.io/package/rollup"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8045 ms. - Missing or incorrect documentation? Open an issue for this package.