Massive pull request brings THREE.js to ES6 Modules

Datetime:2016-08-22 21:37:37         Topic: ECMAScript          Share        Original >>
Here to See The Original Article!!!

@Rich-Harris @mrdoob

I tested both the legacy monolith via script-include (/build/three.js) and modules under /src/ in Webpack. Both worked flawless. The only addition one has to make in order to get it to work in Webpack is:

npm install raw-loader --save-dev

And in webpack.config.js under the loaders section:

{ test: /\.glsl$/, loader: 'raw-loader' }

Rollup seems to be a perfect fit for building this. Compared to the old build-system it is crazy how fast and lean it is. Compiling the lib took one or two seconds.

Can we please move on with this? Seeing as it doesn't seem to break examples and is already giving the source code a more logical touch, this could be the foundation of THREE-next. I feel like this is exactly what people have been asking for and it's pretty much served on a silver platter here.

About List