File tree Expand file tree Collapse file tree 6 files changed +9
-6
lines changed Expand file tree Collapse file tree 6 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const getEsbuildPlugin = <UserOptions>(
5
5
factory : Factory < UserOptions >
6
6
) : UnpluginCombineInstance < UserOptions > [ 'esbuild' ] => {
7
7
return ( userOptions ?: UserOptions ) : EsbuildPlugin => {
8
- const { name, plugins } = factory ( userOptions ! )
8
+ const { name, plugins } = factory ( userOptions ! , { framework : 'esbuild' } )
9
9
return {
10
10
name,
11
11
setup ( build ) {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ export const getPluginList = <UserOptions>(
4
4
factory : Factory < UserOptions >
5
5
) : UnpluginCombineInstance < UserOptions > [ 'plugins' ] => {
6
6
return ( userOptions ?: UserOptions ) => {
7
- const { plugins } = factory ( userOptions ! )
7
+ const { plugins } = factory ( userOptions ! , { } )
8
8
return plugins
9
9
}
10
10
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const getRollupPlugin = <UserOptions>(
5
5
factory : Factory < UserOptions >
6
6
) : UnpluginCombineInstance < UserOptions > [ 'rollup' ] => {
7
7
return ( userOptions ?: UserOptions ) => {
8
- const { plugins } = factory ( userOptions ! )
8
+ const { plugins } = factory ( userOptions ! , { framework : 'rollup' } )
9
9
return resolvePlugins ( plugins , 'rollup' )
10
10
}
11
11
}
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ export interface PluginMap {
21
21
export type PluginType = keyof PluginMap
22
22
export type Plugin = PluginMap [ PluginType ]
23
23
24
- export type Factory < UserOptions > = ( userOptions : UserOptions ) => CombineOptions
24
+ export type Factory < UserOptions > = (
25
+ userOptions : UserOptions ,
26
+ meta : { framework ?: PluginType }
27
+ ) => CombineOptions
25
28
export type FactoryOutput < UserOptions , Return > = [ never ] extends UserOptions
26
29
? ( ) => Return
27
30
: undefined extends UserOptions
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const getVitePlugin = <UserOptions>(
5
5
factory : Factory < UserOptions >
6
6
) : UnpluginCombineInstance < UserOptions > [ 'vite' ] => {
7
7
return ( userOptions ?: UserOptions ) => {
8
- const { plugins } = factory ( userOptions ! )
8
+ const { plugins } = factory ( userOptions ! , { framework : 'vite' } )
9
9
return resolvePlugins ( plugins , 'vite' )
10
10
}
11
11
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const getWebpackPlugin = <UserOptions>(
6
6
factory : Factory < UserOptions >
7
7
) : UnpluginCombineInstance < UserOptions > [ 'webpack' ] => {
8
8
return ( userOptions ?: UserOptions ) => {
9
- const { plugins } = factory ( userOptions ! )
9
+ const { plugins } = factory ( userOptions ! , { framework : 'webpack' } )
10
10
11
11
return ( compiler : Compiler ) => {
12
12
for ( const plugin of resolvePlugins ( plugins , 'webpack' ) ) {
You can’t perform that action at this time.
0 commit comments