feat: supports imports option for auto-import (#12861)
Co-authored-by: 赵江江 <zhaojiangjiang@kingyee.com.cn>
This commit is contained in:
@@ -23,6 +23,8 @@ export interface VantResolverOptions {
|
||||
ssr?: boolean;
|
||||
}
|
||||
|
||||
export type VantImportsOptions = Pick<VantResolverOptions, 'module' | 'ssr'>;
|
||||
|
||||
/**
|
||||
* Button->button; ButtonGroup->button-group
|
||||
*/
|
||||
@@ -124,3 +126,11 @@ export function VantResolver(options: VantResolverOptions = {}) {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function VantImports(options: VantImportsOptions = {}) {
|
||||
const moduleType = getModuleType(options);
|
||||
|
||||
return {
|
||||
[`vant/${moduleType}`]: getAPIMap().keys(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user