1
1
/**
2
2
* This is a development only file for testing types.
3
3
*/
4
- import type { Plugin as RollupPlugin } from 'rolldown'
4
+ import type { Plugin as RolldownPlugin } from 'rolldown'
5
5
import type { Equal , ExpectExtends , ExpectTrue } from '@type-challenges/utils'
6
- import type { Plugin , PluginContextExtension } from '../plugin'
6
+ import type { Plugin as RollupPlugin } from 'rollup'
7
+ import type { Plugin , PluginContextExtension , PluginOption } from '../plugin'
7
8
import type { ROLLUP_HOOKS } from '../constants'
8
9
import type {
9
10
GetHookContextMap ,
@@ -26,13 +27,18 @@ type HooksMissingInConstants = Exclude<
26
27
27
28
export type cases = [
28
29
// Ensure environment plugin hooks are superset of rollup plugin hooks
29
- ExpectTrue < ExpectExtends < RollupPlugin , Plugin > > ,
30
+ ExpectTrue < ExpectExtends < RolldownPlugin , Plugin > > ,
30
31
31
32
// Ensure all Rollup hooks have Vite's plugin context extension
32
33
ExpectTrue < Equal < HooksMissingExtension , never > > ,
33
34
34
35
// Ensure the `ROLLUP_HOOKS` constant is up-to-date
35
36
ExpectTrue < Equal < HooksMissingInConstants , never > > ,
37
+
38
+ // Ensure all Vite plugins, Rolldown plugins, and Rollup plugins can be assigned to `plugins` option
39
+ ExpectTrue < ExpectExtends < PluginOption , RolldownPlugin > > ,
40
+ ExpectTrue < ExpectExtends < PluginOption , RollupPlugin > > ,
41
+ ExpectTrue < ExpectExtends < PluginOption , Plugin > > ,
36
42
]
37
43
38
44
export { }
0 commit comments