Skip to content

Commit 26510c9

Browse files
authored
refactor(vue): limit passable compilerOptions (#8994)
1 parent 4e7b285 commit 26510c9

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

packages/plugin-vue/README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,18 @@ export interface Options {
4545
reactivityTransform?: boolean | string | RegExp | (string | RegExp)[]
4646

4747
// options to pass on to vue/compiler-sfc
48-
script?: Partial<SFCScriptCompileOptions>
49-
template?: Partial<SFCTemplateCompileOptions>
50-
style?: Partial<SFCStyleCompileOptions>
48+
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
49+
template?: Partial<
50+
Pick<
51+
SFCTemplateCompileOptions,
52+
| 'compiler'
53+
| 'compilerOptions'
54+
| 'preprocessOptions'
55+
| 'preprocessCustomRequire'
56+
| 'transformAssetUrls'
57+
>
58+
>
59+
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>
5160
}
5261
```
5362

packages/plugin-vue/src/index.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,18 @@ export interface Options {
3030
isProduction?: boolean
3131

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

3746
/**
3847
* Transform Vue SFCs into custom elements.

0 commit comments

Comments
 (0)