exokitxr / exokit

Native VR/AR/XR engine for JavaScript 🦖
MIT License
995 stars 117 forks source link

Import .mjs support #630

Open avaer opened 5 years ago

avaer commented 5 years ago

With node 11 we can support import and .mjs: https://nodejs.org/api/esm.html

The relevant flag is --experimental-modules.

Related: https://github.com/webmixedreality/exokit/pull/601

avaer commented 5 years ago

Note the VM version of this is available with vm.SourceTextModule and --experimental-vm-modules.

With this, we can do .link() interception to have scripts natively cross-import.

avaer commented 5 years ago

Also note that the THREE.js examples now use module style so they currently do not load in Exokit:

node . https://threejs.org/examples/webgl_animation_cloth.html