@@ -8,13 +8,15 @@ import type sourcemaps from "rollup-plugin-sourcemaps"
88import type replace from "@rollup/plugin-replace"
99// @ts -ignore
1010import type autoExternal from "rollup-plugin-auto-external"
11-
1211import type typescript from "@rollup/plugin-typescript"
12+ // @ts -ignore
1313import type coffeescript from "rollup-plugin-coffee-script"
1414import type json from "@rollup/plugin-json"
15+ // @ts -ignore
1516import type cssOnly from "rollup-plugin-css-only"
1617import type babel from "@rollup/plugin-babel"
1718import type { wasm } from "@rollup/plugin-wasm"
19+ // @ts -ignore
1820import type { asc } from "rollup-plugin-assemblyscript"
1921
2022export type Plugin =
@@ -31,18 +33,18 @@ export type Plugin =
3133 | "sourcemaps"
3234 | "commonjs"
3335 | "resolve"
34- | [ "ts" , typeof typescript ]
35- | [ "babel" , typeof babel ]
36- | [ "coffee" , typeof coffeescript ]
37- | [ "json" , typeof json ]
38- | [ "css" , typeof cssOnly ]
39- | [ "wasm" , typeof wasm ]
40- | [ "as" , typeof asc ]
41- | [ "terser" , typeof terser ]
42- | [ "replace" , typeof replace ]
43- | [ "sourcemaps" , typeof sourcemaps ]
44- | [ "commonjs" , typeof commonjs ]
45- | [ "resolve" , typeof resolve ]
36+ | [ "ts" , typeof typescript , boolean ? ]
37+ | [ "babel" , typeof babel , boolean ? ]
38+ | [ "coffee" , typeof coffeescript , boolean ? ]
39+ | [ "json" , typeof json , boolean ? ]
40+ | [ "css" , typeof cssOnly , boolean ? ]
41+ | [ "wasm" , typeof wasm , boolean ? ]
42+ | [ "as" , typeof asc , boolean ? ]
43+ | [ "terser" , typeof terser , boolean ? ]
44+ | [ "replace" , typeof replace , boolean ? ]
45+ | [ "sourcemaps" , typeof sourcemaps , boolean ? ]
46+ | [ "commonjs" , typeof commonjs , boolean ? ]
47+ | [ "resolve" , typeof resolve , boolean ? ]
4648
4749export function createPlugins (
4850 inputPluginsNames : Array < Plugin > = [ "ts" , "js" , "json" , "coffee" ] ,
@@ -193,6 +195,9 @@ export function createPlugins(
193195 if ( typeof inputPluginsNames [ index ] === "string" ) {
194196 // plugin name only
195197 plugins . push ( pluginFunction ( pluginDefaultOptions ) )
198+ } else if ( typeof inputPluginsNames [ index ] [ 2 ] === "boolean" && inputPluginsNames [ index ] [ 2 ] === true ) {
199+ // plugin with options that override pluginDefaultOptions
200+ plugins . push ( pluginFunction ( { ...pluginDefaultOptions , ...inputPluginsNames [ index ] [ 1 ] } ) )
196201 } else {
197202 // plugin with options
198203 plugins . push ( pluginFunction ( inputPluginsNames [ index ] [ 1 ] ) )
0 commit comments