From 79fb291b601369fdb6072a9d51b4a3e35b109d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Wed, 31 Aug 2022 18:26:41 +0900 Subject: [PATCH] refactor: limit passable compilerOptions (#30) --- README.md | 16 +++++++++++++--- src/index.ts | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 137a30c..8d1a687 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,19 @@ 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' + | 'transpileOptions' + | 'transformAssetUrls' + | 'transformAssetUrlsOptions' + > + > + style?: Partial> } ``` diff --git a/src/index.ts b/src/index.ts index 6a78789..95336b2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,9 +29,19 @@ 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' + | 'transpileOptions' + | 'transformAssetUrls' + | 'transformAssetUrlsOptions' + > + > + style?: Partial> // customElement?: boolean | string | RegExp | (string | RegExp)[] // reactivityTransform?: boolean | string | RegExp | (string | RegExp)[]