My workflow for es6 uses babel and babel-plugin-transform-es2015-modules-system.js only for import / export module conversion for use with system.js. I just use the green browser for all es6 functions except import / export modules .. which are whatwg standard, so not es6.
This works well with legacy (non-es6) libraries, I can "import" all the npm packages I need. Somehow babel, only babel modules are converted, and system.js magically work.
Except for three. I tried this with all three releases: three.js, three.min.js and three.modules.js. The first two fail silently, which leads to the "undefined" module. The third one fails, wanting to track .. I assume for a system.js-like conversion?
So what do I need to do to use three.js in my es6 world?
I think I could use the <script>
and global for three. Or maybe use rollup / webpack to eliminate modules?
But I'm sure there is a reasonable solution. After all, three.js uses es6 internal modules.
source share