unplugin/unplugin-vue-components

Is the project built with rsbuild supported

JoeXin opened this issue · 2 comments

Clear and concise description of the problem

I hope supported it

Suggested solution

I hope supported it

Alternative

No response

Additional context

No response

Validations

sxzz commented

You can use it in Rspack/Rsbuild with:

import Components from 'unplugin-vue-components'

const Plugin = Components.rspack

If you encounter any issues, please provide feedback here.

When troubleshooting, I found here. Currently, the following configuration is OK:

import { defineConfig } from '@rsbuild/core';
import { pluginVue } from '@rsbuild/plugin-vue';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import Components from 'unplugin-vue-components/rspack';
import AutoImport from 'unplugin-auto-import/rspack';

export default defineConfig({
  plugins: [pluginVue()],
  tools: {
    rspack: {
      plugins: [
        AutoImport({
          resolvers: [ElementPlusResolver({})]
        }),
        Components({
          resolvers: [ElementPlusResolver({})]
        })
      ]
    }
  }
});