From 5ccaa836ee0560afdb62e172e6720102a72d8946 Mon Sep 17 00:00:00 2001 From: neverland Date: Sun, 3 Sep 2023 09:40:26 +0800 Subject: [PATCH] docs(auto-import-resolver): add Rspack usage (#12242) --- packages/vant-auto-import-resolver/README.md | 16 ++++++++++++++++ .../vant-auto-import-resolver/README.zh-CN.md | 16 ++++++++++++++++ packages/vant-auto-import-resolver/package.json | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/packages/vant-auto-import-resolver/README.md b/packages/vant-auto-import-resolver/README.md index bf96e0e3a..fd2ec1b70 100644 --- a/packages/vant-auto-import-resolver/README.md +++ b/packages/vant-auto-import-resolver/README.md @@ -76,6 +76,22 @@ module.exports = { }; ``` +### Rspack + +```ts +// rspack.config.js +import Components from 'unplugin-vue-components/rspack'; +import { VantResolver } from '@vant/auto-import-resolver'; + +module.exports = { + plugins: [ + Components({ + resolvers: [VantResolver()], + }), + ], +}; +``` + ### Vue CLI ```ts diff --git a/packages/vant-auto-import-resolver/README.zh-CN.md b/packages/vant-auto-import-resolver/README.zh-CN.md index 6b74ba123..46e14150b 100644 --- a/packages/vant-auto-import-resolver/README.zh-CN.md +++ b/packages/vant-auto-import-resolver/README.zh-CN.md @@ -76,6 +76,22 @@ module.exports = { }; ``` +### Rspack + +```ts +// rspack.config.js +import Components from 'unplugin-vue-components/rspack'; +import { VantResolver } from '@vant/auto-import-resolver'; + +module.exports = { + plugins: [ + Components({ + resolvers: [VantResolver()], + }), + ], +}; +``` + ### Vue CLI ```ts diff --git a/packages/vant-auto-import-resolver/package.json b/packages/vant-auto-import-resolver/package.json index c6ef9b5f2..a18e06ce5 100644 --- a/packages/vant-auto-import-resolver/package.json +++ b/packages/vant-auto-import-resolver/package.json @@ -1,7 +1,7 @@ { "name": "@vant/auto-import-resolver", "version": "1.0.0", - "description": "Vant auto import resolver base unplugin-vue-components", + "description": "Vant auto import resolver based on unplugin-vue-components", "main": "dist/index.cjs.js", "module": "dist/index.esm.mjs", "typings": "dist/index.d.ts",