diff --git a/packages/vant/docs/markdown/quickstart.en-US.md b/packages/vant/docs/markdown/quickstart.en-US.md index 46ed3a006..da242d60d 100644 --- a/packages/vant/docs/markdown/quickstart.en-US.md +++ b/packages/vant/docs/markdown/quickstart.en-US.md @@ -99,7 +99,14 @@ If you are using vite, please use [vite-plugin-style-import](https://github.com/ #### 1. Install Plugin ```bash -npm i vite-plugin-style-import@1.2.0 -D +# with npm +npm i vite-plugin-style-import -D + +# with yarn +yarn add vite-plugin-style-import -D + +# with pnpm +pnpm add vite-plugin-style-import -D ``` #### 2. Configure Plugin @@ -108,19 +115,13 @@ Configure the plugin in the `vite.config.js` file: ```js import vue from '@vitejs/plugin-vue'; -import styleImport from 'vite-plugin-style-import'; +import styleImport, { VantResolve } from 'vite-plugin-style-import'; export default { plugins: [ vue(), styleImport({ - libs: [ - { - libraryName: 'vant', - esModule: true, - resolveStyle: (name) => `vant/es/${name}/style/index`, - }, - ], + resolves: [VantResolve()], }), ], }; diff --git a/packages/vant/docs/markdown/quickstart.zh-CN.md b/packages/vant/docs/markdown/quickstart.zh-CN.md index 933efc374..e33e68e02 100644 --- a/packages/vant/docs/markdown/quickstart.zh-CN.md +++ b/packages/vant/docs/markdown/quickstart.zh-CN.md @@ -100,7 +100,14 @@ pnpm add vant@3 #### 1. 安装插件 ```bash -npm i vite-plugin-style-import@1.2.0 -D +# 通过 npm 安装 +npm i vite-plugin-style-import -D + +# 通过 yarn 安装 +yarn add vite-plugin-style-import -D + +# 通过 pnpm 安装 +pnpm add vite-plugin-style-import -D ``` #### 2. 配置插件 @@ -109,19 +116,13 @@ npm i vite-plugin-style-import@1.2.0 -D ```js import vue from '@vitejs/plugin-vue'; -import styleImport from 'vite-plugin-style-import'; +import styleImport, { VantResolve } from 'vite-plugin-style-import'; export default { plugins: [ vue(), styleImport({ - libs: [ - { - libraryName: 'vant', - esModule: true, - resolveStyle: (name) => `vant/es/${name}/style/index`, - }, - ], + resolves: [VantResolve()], }), ], };