Developmint / nuxt-svg-loader

SVGs as components, also on the server side!
MIT License
144 stars 14 forks source link

doc(readme): add information for typescript user #36

Closed RomainLanz closed 8 months ago

RomainLanz commented 5 years ago

Hey 👋

When using this package with TypeScript the engine doesn't know by default how to deal with svg file. Therefore we need to defer the type for these imports.

More information: https://webpack.js.org/guides/typescript/#importing-other-assets

RomainLanz commented 5 years ago

Actually after some thinking I believe it would be better if this package directly add the type and people simply updates their tsconfig.json to add nuxt-svg-loader in the types array.

What do you think is the best?

manniL commented 5 years ago

@RomainLanz I'm happy with including the types. On the other hand, that might be an issue for https://github.com/egoist/svg-to-vue-component instead (the underlying package) :thinking: