unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.66k stars 341 forks source link

使用unplugin-vue-components/rspack导致图片不生效 #697

Open galaxy-s10 opened 9 months ago

galaxy-s10 commented 9 months ago

Describe the bug

const ComponentsPlugin = require('unplugin-vue-components/rspack');

/**

@type {import('@rspack/cli').Configuration} */ module.exports = { context: __dirname, entry: { main: './src/main.tsx', }, builtins: { html: [ { template: './index.html', }, ], }, module: { rules: [ { test: /.svg$/, type: 'asset', }, { test: /.jpg$/, type: 'asset', }, ], }, // 已经是最小案例了,用了ComponentsPlugin后,import aaaJpg from './aaa.jpg' 就不生效 // 注释ComponentsPlugin之后,就正常了 plugins: [ComponentsPlugin({})], };

Reproduction

https://github.com/galaxy-s10/issue-demo/tree/master/demo3

System Info

const ComponentsPlugin = require('unplugin-vue-components/rspack');

/**

@type {import('@rspack/cli').Configuration}
*/
module.exports = {
context: __dirname,
entry: {
main: './src/main.tsx',
},
builtins: {
html: [
{
template: './index.html',
},
],
},
module: {
rules: [
{
test: /.svg$/,
type: 'asset',
},
{
test: /.jpg$/,
type: 'asset',
},
],
},
// 已经是最小案例了,用了ComponentsPlugin后,import aaaJpg from './aaa.jpg' 就不生效
// 注释ComponentsPlugin之后,就正常了
plugins: [ComponentsPlugin({})],
};

Used Package Manager

pnpm

Validations

galaxy-s10 commented 9 months ago

hey,i set a mini demo :https://github.com/galaxy-s10/issue-demo/tree/master/demo3

WaynePluto commented 9 months ago

Rspack using the unplugin-auto-import plugin will also cause the image not to take effect. It could be the same thing.

galaxy-s10 commented 9 months ago

Rspack using the unplugin-auto-import plugin will also cause the image not to take effect. It could be the same thing.

oh my god,