Skip to content

Commit 79fb291

Browse files
authored
refactor: limit passable compilerOptions (#30)
1 parent 460fb4a commit 79fb291

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,19 @@ export interface Options {
2121
isProduction?: boolean
2222

2323
// options to pass on to vue/compiler-sfc
24-
script?: Partial<SFCScriptCompileOptions>
25-
template?: Partial<SFCTemplateCompileOptions>
26-
style?: Partial<SFCStyleCompileOptions>
24+
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
25+
template?: Partial<
26+
Pick<
27+
SFCTemplateCompileOptions,
28+
| 'compiler'
29+
| 'compilerOptions'
30+
| 'preprocessOptions'
31+
| 'transpileOptions'
32+
| 'transformAssetUrls'
33+
| 'transformAssetUrlsOptions'
34+
>
35+
>
36+
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>
2737
}
2838
```
2939

src/index.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,19 @@ export interface Options {
2929
isProduction?: boolean
3030

3131
// options to pass on to vue/compiler-sfc
32-
script?: Partial<SFCScriptCompileOptions>
33-
template?: Partial<SFCTemplateCompileOptions>
34-
style?: Partial<SFCStyleCompileOptions>
32+
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
33+
template?: Partial<
34+
Pick<
35+
SFCTemplateCompileOptions,
36+
| 'compiler'
37+
| 'compilerOptions'
38+
| 'preprocessOptions'
39+
| 'transpileOptions'
40+
| 'transformAssetUrls'
41+
| 'transformAssetUrlsOptions'
42+
>
43+
>
44+
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>
3545

3646
// customElement?: boolean | string | RegExp | (string | RegExp)[]
3747
// reactivityTransform?: boolean | string | RegExp | (string | RegExp)[]

0 commit comments

Comments
 (0)