From b7b3e654499f61d047dec61c71e17ac32cf51769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Fri, 15 Jul 2022 18:43:24 +0900 Subject: [PATCH] refactor(vue): limit passable compilerOptions (#8994) --- packages/plugin-vue/README.md | 15 ++++++++++++--- packages/plugin-vue/src/index.ts | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/packages/plugin-vue/README.md b/packages/plugin-vue/README.md index 5f2236edf02604..be02ab7ae4ab36 100644 --- a/packages/plugin-vue/README.md +++ b/packages/plugin-vue/README.md @@ -45,9 +45,18 @@ export interface Options { reactivityTransform?: boolean | string | RegExp | (string | RegExp)[] // options to pass on to vue/compiler-sfc - script?: Partial - template?: Partial - style?: Partial + script?: Partial> + template?: Partial< + Pick< + SFCTemplateCompileOptions, + | 'compiler' + | 'compilerOptions' + | 'preprocessOptions' + | 'preprocessCustomRequire' + | 'transformAssetUrls' + > + > + style?: Partial> } ``` diff --git a/packages/plugin-vue/src/index.ts b/packages/plugin-vue/src/index.ts index 6bc0db06fe2b10..f00beb36e5ca1a 100644 --- a/packages/plugin-vue/src/index.ts +++ b/packages/plugin-vue/src/index.ts @@ -30,9 +30,18 @@ export interface Options { isProduction?: boolean // options to pass on to vue/compiler-sfc - script?: Partial - template?: Partial - style?: Partial + script?: Partial> + template?: Partial< + Pick< + SFCTemplateCompileOptions, + | 'compiler' + | 'compilerOptions' + | 'preprocessOptions' + | 'preprocessCustomRequire' + | 'transformAssetUrls' + > + > + style?: Partial> /** * Transform Vue SFCs into custom elements.