@@ -10,16 +10,15 @@ import { Plugin } from "rollup"
10
10
import builder from "core-js-builder"
11
11
import MagicString from "magic-string"
12
12
13
- export interface CoreJSOptions {
14
- /** Browserslist or core-js-compat format, if not set then browserslist config is tired to load */
15
- targets ?:
16
- | string
17
- | readonly string [ ]
18
- | Record < string , string | readonly string [ ] >
13
+ type CoreJSOptions = Parameters < typeof builder > [ 0 ]
14
+
15
+ export interface CoreJSPluginOptions {
16
+ /** Browserslist or core-js-compat format, if not set then browserslist config is tried to load */
17
+ targets ?: CoreJSOptions [ "targets" ]
19
18
/** CoreJS modules to use, defaults to "core-js/es" */
20
- modules ?: string | readonly string [ ] | readonly RegExp [ ]
19
+ modules ?: CoreJSOptions [ "modules" ]
21
20
/** CoreJS modules to exclude */
22
- exclude ?: string | readonly string [ ] | readonly RegExp [ ]
21
+ exclude ?: CoreJSOptions [ "exclude" ]
23
22
/** Add comment with used modules within bundle */
24
23
summary ?: {
25
24
size : boolean
@@ -28,9 +27,9 @@ export interface CoreJSOptions {
28
27
}
29
28
30
29
export function corejsPlugin (
31
- options : CoreJSOptions = { modules : "core-js/es" }
30
+ options : CoreJSPluginOptions = { modules : "core-js/es" }
32
31
) {
33
- const config = {
32
+ const config : CoreJSOptions = {
34
33
format : "esm" ,
35
34
modules : options . modules ,
36
35
exclude : options . exclude ,
0 commit comments