Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

Commit 75434c1

Browse files
committed
refactor(types): more explicit options type
1 parent 66f8f65 commit 75434c1

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

Diff for: src/index.ts

+10-17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
SFCTemplateCompileOptions,
1818
SFCTemplateCompileResults,
1919
SFCStyleCompileOptions,
20+
SFCAsyncStyleCompileOptions,
2021
} from '@vue/compiler-sfc'
2122
import fs from 'fs'
2223
import createDebugger from 'debug'
@@ -28,12 +29,7 @@ import { createFilter } from 'rollup-pluginutils'
2829

2930
const debug = createDebugger('rollup-plugin-vue')
3031

31-
export interface Options
32-
extends Pick<
33-
SFCTemplateCompileOptions,
34-
'compiler' | 'compilerOptions' | 'transformAssetUrls'
35-
>,
36-
Pick<SFCStyleCompileOptions, 'preprocessCustomRequire'> {
32+
export interface Options {
3733
include: string | RegExp | (string | RegExp)[]
3834
exclude: string | RegExp | (string | RegExp)[]
3935
target: 'node' | 'browser'
@@ -45,17 +41,14 @@ export interface Options
4541
// rollup plugins
4642
preprocessStyles?: boolean
4743

48-
// TODO this will be exposed via SFCAsyncStyleCompileOptions which we forgot
49-
// to export in @vue/compiler-sfc
50-
cssModulesOptions?: {
51-
scopeBehaviour?: 'global' | 'local'
52-
globalModulePaths?: string[]
53-
generateScopedName?:
54-
| string
55-
| ((name: string, filename: string, css: string) => string)
56-
hashPrefix?: string
57-
localsConvention?: 'camelCase' | 'camelCaseOnly' | 'dashes' | 'dashesOnly'
58-
}
44+
// sfc template options
45+
compiler?: SFCTemplateCompileOptions['compiler']
46+
compilerOptions?: SFCTemplateCompileOptions['compilerOptions']
47+
transformAssetUrls?: SFCTemplateCompileOptions['transformAssetUrls']
48+
49+
// sfc style options
50+
preprocessCustomRequire?: SFCAsyncStyleCompileOptions['preprocessCustomRequire']
51+
cssModulesOptions?: SFCAsyncStyleCompileOptions['modulesOptions']
5952
}
6053

6154
const defaultOptions: Options = {

0 commit comments

Comments
 (0)