These are chat archives for systemjs/systemjs

Nov 2016
Owen Densmore
Nov 14 2016 01:04

I'm using three.js which internally uses modules, and then uses rollup. It imports nicely like so via System.js:

import * as THREE from 'etc/three.min.js'

But three.js has several "controls" that are external to their repo that simply insert themselves into the THREE namespace like this:

THREE.OrbitControls = function ( object, domElement ) {...}

It uses a script tag to do this:

<script src="etc/OrbitControls.js"></script>

I tried System.import('etc/OrbitControls.js') in the namespace that imports three.js, but that doesn't seem to work.

Is there any stunt for loading a global module OrbitControls this within an es6 module which imports THREE, thus has THREE in scope for OrbitControls to use?