When it comes to working with ES6, my workflow involves using Babel and babel-plugin-transform-es2015-modules-system.js specifically to transform module import/export for compatibility with system.js. I rely on a "green" browser for most ES6 features except for modules importing/exporting, which are a whatwg standard and not technically considered "ES6".
This setup works seamlessly with non-ES6 libraries, allowing me to easily "import" all the necessary npm packages. However, when it comes to three.js, things get a bit trickier. Despite trying different releases like three.js, three.min.js, and three.modules.js, I encounter issues such as undefined modules or a requirement for traceur (possibly for a system.js-like transformation).
So, how can I successfully integrate three.js into my ES6 environment? One option could be reverting to using a <script>
tag and creating a global variable for three. Alternatively, I could explore solutions like Rollup/webpack to bypass the module complications.
Yet, I believe there must be a more elegant solution out there, given that three.js itself utilizes ES6 modules internally.