Skip to content

Commit

Permalink
refactor(vue): limit passable compilerOptions (#8994)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Jul 15, 2022
1 parent 4e7b285 commit 26510c9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 12 additions & 3 deletions packages/plugin-vue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,18 @@ export interface Options {
reactivityTransform?: boolean | string | RegExp | (string | RegExp)[]

// options to pass on to vue/compiler-sfc
script?: Partial<SFCScriptCompileOptions>
template?: Partial<SFCTemplateCompileOptions>
style?: Partial<SFCStyleCompileOptions>
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
template?: Partial<
Pick<
SFCTemplateCompileOptions,
| 'compiler'
| 'compilerOptions'
| 'preprocessOptions'
| 'preprocessCustomRequire'
| 'transformAssetUrls'
>
>
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>
}
```

Expand Down
15 changes: 12 additions & 3 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ export interface Options {
isProduction?: boolean

// options to pass on to vue/compiler-sfc
script?: Partial<SFCScriptCompileOptions>
template?: Partial<SFCTemplateCompileOptions>
style?: Partial<SFCStyleCompileOptions>
script?: Partial<Pick<SFCScriptCompileOptions, 'babelParserPlugins'>>
template?: Partial<
Pick<
SFCTemplateCompileOptions,
| 'compiler'
| 'compilerOptions'
| 'preprocessOptions'
| 'preprocessCustomRequire'
| 'transformAssetUrls'
>
>
style?: Partial<Pick<SFCStyleCompileOptions, 'trim'>>

/**
* Transform Vue SFCs into custom elements.
Expand Down

0 comments on commit 26510c9

Please sign in to comment.