Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
galaxy-s10 opened this issue Sep 15, 2023 · 7 comments
Closed

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

galaxy-s10 opened this issue Sep 15, 2023 · 7 comments
Labels
bug Something isn't working stale

Comments

@galaxy-s10
Copy link

galaxy-s10 commented Sep 15, 2023

System Info

rspack serve

Details

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({})],
    };

Reproduce link

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

Reproduce Steps

直接运行npm run dev即可,已经是最小案例了,用了ComponentsPlugin后,import aaaJpg from './aaa.jpg' 就不生效,注释ComponentsPlugin之后,重新npm run dev就正常了

@galaxy-s10
Copy link
Author

你好,我上传了一个最小案例:https://github.com/galaxy-s10/issue-demo/tree/master/demo3

@hardfist
Copy link
Contributor

目前unplugin的rspack版本并没支持所有功能,因此这个可能导致插件的功能存在问题

@galaxy-s10
Copy link
Author

目前unplugin的rspack版本并没支持所有功能,因此这个可能导致插件的功能存在问题

嗯,unplugin插件也提了对应的issue:unplugin/unplugin-vue-components#697

@hardfist
Copy link
Contributor

unjs/unplugin#328 maybe related to this

@hyf0 hyf0 removed the pending triage The issue/PR is currently untouched. label Sep 21, 2023
@JasonBoy
Copy link

@galaxy-s10 a possible workaround if you want to try https://juejin.cn/post/7273024616522842149#heading-7

Copy link

stale bot commented Dec 26, 2023

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Dec 26, 2023
@chenjiahan
Copy link
Member

This issue has been fixed by unplugin, I can not reproduce it in the demo now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

5 participants