Skip to content

Commit

Permalink
feat: support rspack (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
loilo committed May 30, 2023
1 parent 413dc0c commit c14f420
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
17 changes: 16 additions & 1 deletion README.md
Expand Up @@ -8,7 +8,7 @@ On-demand components auto importing for Vue.

- 💚 Supports both Vue 2 and Vue 3 out-of-the-box.
- ✨ Supports both components and directives.
- ⚡️ Supports Vite, Webpack, Vue CLI, Rollup, esbuild and more, powered by <a href="https://github.com/unjs/unplugin">unplugin</a>.
- ⚡️ Supports Vite, Webpack, Rspack, Vue CLI, Rollup, esbuild and more, powered by <a href="https://github.com/unjs/unplugin">unplugin</a>.
- 🏝 Tree-shakable, only registers the components you use.
- 🪐 Folder names as namespaces.
- 🦾 Full TypeScript support.
Expand Down Expand Up @@ -81,6 +81,21 @@ module.exports = {

<br></details>

<details>
<summary>Rspack</summary><br>

```ts
// rspack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-vue-components/rspack')({ /* options */ }),
],
}
```

<br></details>

<details>
<summary>Nuxt</summary><br>

Expand Down
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -48,6 +48,11 @@
"require": "./dist/webpack.js",
"import": "./dist/webpack.mjs"
},
"./rspack": {
"types": "./dist/rspack.d.ts",
"require": "./dist/rspack.js",
"import": "./dist/rspack.mjs"
},
"./esbuild": {
"types": "./dist/esbuild.d.ts",
"require": "./dist/esbuild.js",
Expand Down Expand Up @@ -105,7 +110,7 @@
"magic-string": "^0.30.0",
"minimatch": "^7.4.2",
"resolve": "^1.22.1",
"unplugin": "^1.1.0"
"unplugin": "^1.3.1"
},
"devDependencies": {
"@antfu/eslint-config": "^0.36.0",
Expand Down
17 changes: 13 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/rspack.ts
@@ -0,0 +1,3 @@
import unplugin from '.'

export default unplugin.rspack

0 comments on commit c14f420

Please sign in to comment.