From c14f420370a6380cdaa0d48ab405b281cf64a300 Mon Sep 17 00:00:00 2001 From: Florian Reuschel Date: Tue, 30 May 2023 11:30:56 +0200 Subject: [PATCH] feat: support rspack (#637) --- README.md | 17 ++++++++++++++++- package.json | 7 ++++++- pnpm-lock.yaml | 17 +++++++++++++---- src/rspack.ts | 3 +++ 4 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 src/rspack.ts diff --git a/README.md b/README.md index 75eefdd5..fe2863a6 100644 --- a/README.md +++ b/README.md @@ -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 unplugin. +- ⚡️ Supports Vite, Webpack, Rspack, Vue CLI, Rollup, esbuild and more, powered by unplugin. - 🏝 Tree-shakable, only registers the components you use. - 🪐 Folder names as namespaces. - 🦾 Full TypeScript support. @@ -81,6 +81,21 @@ module.exports = {
+
+Rspack
+ +```ts +// rspack.config.js +module.exports = { + /* ... */ + plugins: [ + require('unplugin-vue-components/rspack')({ /* options */ }), + ], +} +``` + +
+
Nuxt
diff --git a/package.json b/package.json index e6e426e8..6300264b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ca19e96..45ce40f3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,7 +32,7 @@ importers: rollup: ^3.18.0 tsup: ^6.6.3 typescript: ^4.9.5 - unplugin: ^1.1.0 + unplugin: ^1.3.1 vite: ^4.1.4 vitest: ^0.29.2 vue: 3.2.45 @@ -46,7 +46,7 @@ importers: 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_ycpbpc6yetojsgtrx3mwntkhsu '@babel/parser': 7.21.2 @@ -9682,7 +9682,7 @@ packages: acorn: 8.8.2 estree-walker: 3.0.3 magic-string: 0.27.0 - unplugin: 1.1.0 + unplugin: 1.3.1 dev: true /unicode-canonical-property-names-ecmascript/2.0.0: @@ -9721,7 +9721,7 @@ packages: pkg-types: 1.0.2 scule: 1.0.0 strip-literal: 1.0.0 - unplugin: 1.1.0 + unplugin: 1.3.1 transitivePeerDependencies: - rollup dev: true @@ -9862,6 +9862,15 @@ packages: chokidar: 3.5.3 webpack-sources: 3.2.3 webpack-virtual-modules: 0.5.0 + dev: true + + /unplugin/1.3.1: + resolution: {integrity: sha512-h4uUTIvFBQRxUKS2Wjys6ivoeofGhxzTe2sRWlooyjHXVttcVfV/JiavNd3d4+jty0SVV0dxGw9AkY9MwiaCEw==} + dependencies: + acorn: 8.8.2 + chokidar: 3.5.3 + webpack-sources: 3.2.3 + webpack-virtual-modules: 0.5.0 /untyped/1.2.2: resolution: {integrity: sha512-EANYd5L6AdpgfldlgMcmvOOnj092nWhy0ybhc7uhEH12ipytDYz89EOegBQKj8qWL3u1wgYnmFjADhsuCJs5Aw==} diff --git a/src/rspack.ts b/src/rspack.ts new file mode 100644 index 00000000..a5c7be41 --- /dev/null +++ b/src/rspack.ts @@ -0,0 +1,3 @@ +import unplugin from '.' + +export default unplugin.rspack