1
1
import type { AstNode , EmittedAsset , PluginContextMeta as RollupContextMeta , Plugin as RollupPlugin , SourceMapInput } from 'rollup'
2
2
import type { Compiler as WebpackCompiler , WebpackPluginInstance } from 'webpack'
3
3
import type { Plugin as VitePlugin } from 'vite'
4
+ import type { Plugin as RolldownPlugin } from '@rolldown/node'
4
5
import type { BuildOptions , Plugin as EsbuildPlugin , Loader } from 'esbuild'
5
6
import type { Compiler as RspackCompiler , RspackPluginInstance } from '@rspack/core'
6
7
import type VirtualModulesPlugin from 'webpack-virtual-modules'
@@ -9,6 +10,7 @@ import type { EsbuildPluginBuild } from './esbuild'
9
10
export {
10
11
EsbuildPlugin ,
11
12
RollupPlugin ,
13
+ RolldownPlugin ,
12
14
VitePlugin ,
13
15
WebpackPluginInstance ,
14
16
RspackPluginInstance ,
@@ -71,6 +73,7 @@ export interface UnpluginOptions {
71
73
webpack ?: ( compiler : WebpackCompiler ) => void
72
74
rspack ?: ( compiler : RspackCompiler ) => void
73
75
vite ?: Partial < VitePlugin >
76
+ rolldown ?: Partial < RolldownPlugin >
74
77
esbuild ?: {
75
78
// using regexp in esbuild improves performance
76
79
onResolveFilter ?: RegExp
@@ -99,14 +102,15 @@ export type UnpluginFactoryOutput<UserOptions, Return> = undefined extends UserO
99
102
export interface UnpluginInstance < UserOptions , Nested extends boolean = boolean > {
100
103
rollup : UnpluginFactoryOutput < UserOptions , Nested extends true ? Array < RollupPlugin > : RollupPlugin >
101
104
vite : UnpluginFactoryOutput < UserOptions , Nested extends true ? Array < VitePlugin > : VitePlugin >
105
+ rolldown : UnpluginFactoryOutput < UserOptions , Nested extends true ? Array < RolldownPlugin > : RolldownPlugin >
102
106
webpack : UnpluginFactoryOutput < UserOptions , WebpackPluginInstance >
103
107
rspack : UnpluginFactoryOutput < UserOptions , RspackPluginInstance >
104
108
esbuild : UnpluginFactoryOutput < UserOptions , EsbuildPlugin >
105
109
raw : UnpluginFactory < UserOptions , Nested >
106
110
}
107
111
108
112
export type UnpluginContextMeta = Partial < RollupContextMeta > & ( {
109
- framework : 'rollup' | 'vite'
113
+ framework : 'rollup' | 'vite' | 'rolldown'
110
114
} | {
111
115
framework : 'webpack'
112
116
webpack : {
0 commit comments