Roots Discourse

Importing svg.js 3.0 fails because of spread operator


I’m trying to manipulate a couple of SVGs in a Sage 9 theme, but I’m having trouble importing the latest version of svg.js.

The library is imported like this: import { SVG } from '@svgdotjs/svg.js'; but the webpack compiler is complaining afterwards: You may need an appropriate loader to handle this file type.. All the errors are lines that use the spread operator.

Is there are loader available to work around this issue, or am I importing the library incorrectly?