Closed tanc closed 3 years ago
I suspect it is this line: https://github.com/cereschen/vite-plugin-svg-sprite-component/blob/main/src/index.ts#L146
style
is considered read only in the spec and should not be set directly. Maybe something like:
svg.style.setProperty('display', 'none')
I just tested this by doing a find/replace on the compiled legacy output and confirmed that was the problem. The plugin works nicely and somehow is polyfilled to provide the svg use
facility in IE11
I'm transpiling this plugin as part of Vite legacy transpilation and IE11 is throwing the following error:
I've identified the issue as coming from this plugin by the time-honoured elimination method. I realise this may not be high on your priority list as IE11 doesn't support
use
with external SVGs but I'm hoping to use this plugin with a polyfill.