vite-svg icon indicating copy to clipboard operation
vite-svg copied to clipboard

Can the plugin use default export?

Open uniquejava opened this issue 4 years ago • 3 comments

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 avatar Nov 04 '20 04:11 uniquejava

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

uniquejava avatar Nov 04 '20 04:11 uniquejava

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

damianstasik avatar Nov 24 '20 22:11 damianstasik

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?

richardtallent avatar Dec 04 '20 18:12 richardtallent