How to import the SVGRenderer of Tree in a Vue project

Posted on November 18, 2019

Importing three.js in ES6 is something like:

import * as THREE from 'three'

But if you want to import some external resources, such as the SVGRenderer, you have to rely with the full local path to that module:

import { SVGRenderer } from '@/../node_modules/three/examples/jsm/renderers/SVGRenderer.js'

Now you can render your 3D scene in full SVG!