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

Can the plugin use default export? #10

Open
uniquejava opened this issue Nov 4, 2020 · 3 comments
Open

Can the plugin use default export? #10

uniquejava opened this issue Nov 4, 2020 · 3 comments

Comments

@uniquejava
Copy link

Thank you for this plugin.

I find the usage for this plugin is a little verbose.

Can we simply do this

import SkipIcon from '/@assets/skip_next-24px.svg';

instead of

import  {VueComponet as SkipIcon} from '/@assets/skip_next-24px.svg';

I see an equivalent react plugin here: https://developer.aliyun.com/mirror/npm/package/vite-plugin-svg-react

I just thought their usage is more concise.

@uniquejava
Copy link
Author

Ah, I just learned your example project, I see why.

@damianstasik
Copy link
Owner

Yes, I wanted to keep the default behavior, but I could check whether making it an option would be something feasible.

@richardtallent
Copy link

I'm still fairly new to using ES module imports, is there a benefit I'm not aware of for having the export named rather than using default (when there's only one class being exported). Or is retaining the VueComponent name a concern of backward compatibility?

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