Skip to content

Commit 66a2a78

Browse files
committed
feat(config): add withDefaltSkip
1 parent 93d07e7 commit 66a2a78

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

mod.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,10 @@ export async function loadOptions(options: Options) {
154154
const config = await loadConfig();
155155
const name = config?.name ?? defaultConfig.name;
156156
const output = `${name}.${options.type}`;
157-
const externalSkip = config?.skip ?? defaultConfig.skip;
157+
const externalSkip = config?.skip ?? [];
158+
if (config?.withDefaltSkip) {
159+
externalSkip.push(...defaultConfig.skip);
160+
}
158161
return {
159162
cwd,
160163
output,
@@ -165,6 +168,6 @@ export async function loadOptions(options: Options) {
165168
return {
166169
cwd,
167170
type: options.type,
168-
output: `default.${options.type}`,
171+
output: `${defaultConfig.name}.${options.type}`,
169172
};
170173
}

src/config.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
export type ExternalSkip = Array<string | RegExp>;
22

33
export interface Config {
4+
/**
5+
* @default "default"
6+
*/
47
name?: string;
8+
/**
9+
* @default [/(?<=[\\\/])(node_modules|temp|cache|dist|\.(nuxt|nitro|output))(?=[\\\/])/]
10+
*/
511
skip?: ExternalSkip;
12+
/**
13+
* @default true
14+
*/
15+
withDefaltSkip?: boolean;
616
}
717

8-
export const defaultConfig: Config = {
18+
export const defaultConfig: Required<Config> = {
919
name: "default",
1020
skip: [
1121
/(?<=[\\\/])(node_modules|temp|cache|dist|\.(nuxt|nitro|output))(?=[\\\/])/,
1222
],
23+
withDefaltSkip: true,
1324
};

0 commit comments

Comments
 (0)