Skip to content

Commit e9233dc

Browse files
committed
feat: add options
1 parent 365b67e commit e9233dc

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
.DS_Store
33
dist
44
.idea
5+
.unimport-components.json
56
components.d.ts

examples/vite-vue2/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const config: UserConfig = {
88
Components({
99
transformer: 'vue2',
1010
dts: 'src/components.d.ts',
11+
dumpUnimportComponents: true,
1112
}),
1213
],
1314
build: {

examples/vite-vue3/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const config: UserConfig = {
3737
componentPrefix: 'i',
3838
}),
3939
],
40+
dumpUnimportComponents: true,
4041
}),
4142
],
4243
build: {

src/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@ export interface Options {
205205
* @default true
206206
*/
207207
sourcemap?: boolean
208+
209+
/**
210+
* Save unimport components into a JSON file for other tools to consume.
211+
* Provide a filepath to save the JSON file.
212+
*
213+
* When set to `true`, it will save to `./.unimport-components.json`
214+
*
215+
* @default false
216+
*/
217+
dumpUnimportComponents?: boolean | string
208218
}
209219

210220
export type ResolvedOptions = Omit<

0 commit comments

Comments
 (0)