unplugin-vue-components icon indicating copy to clipboard operation
unplugin-vue-components copied to clipboard

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

Open galaxy-s10 opened this issue 2 years ago • 3 comments

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

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

galaxy-s10 avatar Sep 15 '23 11:09 galaxy-s10

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

galaxy-s10 avatar Sep 16 '23 04:09 galaxy-s10

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

WaynePluto avatar Sep 16 '23 07:09 WaynePluto

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,

galaxy-s10 avatar Sep 16 '23 07:09 galaxy-s10