Skip to content

Commit

Permalink
docs: add guide for on-demand import with Rspack (#16841)
Browse files Browse the repository at this point in the history
* docs: add guide for on-demand import with Rspack

* docs: fix
  • Loading branch information
chenjiahan committed May 13, 2024
1 parent dba8181 commit c2843cd
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion docs/en-US/guide/quickstart.md
Expand Up @@ -52,7 +52,7 @@ First you need to install `unplugin-vue-components` and `unplugin-auto-import`.
npm install -D unplugin-vue-components unplugin-auto-import
```

Then add the code below into your `Vite` or `Webpack` config file.
Then add the code below into your `Vite`, `Webpack` or `Rspack` config file.

##### Vite

Expand Down Expand Up @@ -98,6 +98,29 @@ module.exports = {
}
```

##### Rspack

Example of how to register these plugins in [Rspack](https://rspack.dev/):

```js
// rspack.config.js
const AutoImport = require('unplugin-auto-import/rspack')
const Components = require('unplugin-vue-components/rspack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {
// ...
plugins: [
AutoImport({
resolvers: [ElementPlusResolver()],
}),
Components({
resolvers: [ElementPlusResolver()],
}),
],
}
```

For more bundlers ([Rollup](https://rollupjs.org/), [Vue CLI](https://cli.vuejs.org/)) and configs please reference [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components#installation) and [unplugin-auto-import](https://github.com/antfu/unplugin-auto-import#install).

#### Nuxt
Expand Down

0 comments on commit c2843cd

Please sign in to comment.