How to import the SVGRenderer of Tree in a Vue project

18th November, 2019 1 min. read

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!


Spotted a typo or (likely) a grammar error? Send a pull request.