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

[Bug]: Using html-loader will cause vue-loader to fail #2762

Closed
aliothor opened this issue Jul 2, 2024 · 3 comments
Closed

[Bug]: Using html-loader will cause vue-loader to fail #2762

aliothor opened this issue Jul 2, 2024 · 3 comments

Comments

@aliothor
Copy link

aliothor commented Jul 2, 2024

Version

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
    Memory: 19.14 GB / 31.86 GB
  Browsers:
    Edge: Chromium (126.0.2592.81), ChromiumDev (127.0.2610.3)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @rsbuild/core: ^0.7.10 => 0.7.10
    @rsbuild/plugin-vue: ^0.7.10 => 0.7.10

Details

Using html-loader will cause vue-loader to fail
rsbuild配置
报错信息

Reproduce link

https://github.com/aliothor/rsbuild-issue

Reproduce Steps

  1. pnpm i
  2. pnpm dev
@aliothor aliothor added the 🐞 bug Something isn't working label Jul 2, 2024
@chenjiahan chenjiahan changed the title [Bug]: 使用html-loader时会导致vue-loader失效 [Bug]: Using html-loader will cause vue-loader to fail Jul 2, 2024
@xc2
Copy link
Collaborator

xc2 commented Jul 2, 2024

Please exclude /\.vue\.html$/i. e.g.,

      addRules({
        test: /\.html$/i,
        exclude: /\.vue.html$/,
        loader: 'html-loader',
      })

@xc2 xc2 removed the 🐞 bug Something isn't working label Jul 2, 2024
@aliothor
Copy link
Author

aliothor commented Jul 2, 2024

Please exclude /\.vue\.html$/i. e.g.,

      addRules({
        test: /\.html$/i,
        exclude: /\.vue.html$/,
        loader: 'html-loader',
      })

Thanks, this solved my problem

@xc2
Copy link
Collaborator

xc2 commented Jul 2, 2024

Btw, please exclude /\/@rsbuild\/core\// as well for rsbuild's builtin html template.

@xc2 xc2 closed this as completed Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants