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

Svg as inline component not working in vue 3 with rspack #8117

Closed
hammadahamed opened this issue Oct 14, 2024 · 4 comments
Closed

Svg as inline component not working in vue 3 with rspack #8117

hammadahamed opened this issue Oct 14, 2024 · 4 comments

Comments

@hammadahamed
Copy link

hammadahamed commented Oct 14, 2024

Is the any loader that can be used to load svg's as inline components in rspack
vite has vite-svg-loader

tried different ways nothing is working in rspack

@LingyuCoder
Copy link
Collaborator

cc @9aoy

@9aoy
Copy link
Collaborator

9aoy commented Oct 16, 2024

@hammadahamed
Copy link
Author

cc @9aoy

This isn't working either.
vue-svg-loader keeps throwing the template-compiler-sfc version error (which it uses internally)., which is basically intended to be for vue2

@hammadahamed
Copy link
Author

hammadahamed commented Oct 16, 2024

try https://github.com/damianstasik/vue-svg-loader
cc @9aoy

✅ Resolved it using....

there is another package vue-svg-loader-2.
with this i can just import the .svg files like a regular component.

and my setup in rspack.config.ts is

      {
        test: /\.svg$/,
        use: ["vue-loader", , "vue-svg-loader-2"],
      }

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

3 participants