From 41d4778cdb42b4eafc50c2e9524148cd3ac12e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Thu, 16 May 2024 19:40:55 +0800 Subject: [PATCH] fix: don't specify default value for `include` & `exclude` --- src/core/options.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/options.ts b/src/core/options.ts index 51fcf18..e9727fd 100644 --- a/src/core/options.ts +++ b/src/core/options.ts @@ -63,6 +63,8 @@ type Overwrite = Pick> & U export type OptionsResolved = Overwrite< Required, { + include: BaseOptions['include'] + exclude: BaseOptions['exclude'] enforce: BaseOptions['enforce'] values: ReplaceItem[] } @@ -70,8 +72,8 @@ export type OptionsResolved = Overwrite< export function resolveOptions(options: Options): OptionsResolved { return { - include: options.include || [/\.[cm]?[jt]sx?$/], - exclude: options.exclude || [/node_modules/], + include: options.include, + exclude: options.exclude, sourceMap: options.sourceMap ?? true, delimiters: options.delimiters || ['\\b', '\\b(?!\\.)'], preventAssignment: options.preventAssignment ?? false,