Skip to content

Commit f00471a

Browse files
committed
feat: add options
1 parent b5e2b76 commit f00471a

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
@@ -198,6 +198,16 @@ export interface Options {
198198
* Vue version of project. It will detect automatically if not specified.
199199
*/
200200
version?: 2 | 2.7 | 3
201+
202+
/**
203+
* Save unimport components into a JSON file for other tools to consume.
204+
* Provide a filepath to save the JSON file.
205+
*
206+
* When set to `true`, it will save to `./.unimport-components.json`
207+
*
208+
* @default false
209+
*/
210+
dumpUnimportComponents?: boolean | string
201211
}
202212

203213
export type ResolvedOptions = Omit<

0 commit comments

Comments
 (0)