Cesium usage with Webpack?

I’m doing some prototyping for a new project, and am hoping to use the latest and greatest in JS tooling: NPM, React, ES6, and Webpack. Since Cesium was just officially released as an NPM package, I installed that, and tried importing Cesium. Unfortunately, things aren’t looking good at the moment. If I run things as-is, Node blows up with a “process out of memory” error. If I add “–max_old_space_size=4096” as an argument to webpack-dev-server, it chugs along for a while and sucks up a couple gigs, then throws up complaints about all the JSON, JPG, and XML files under Cesium/Source/Assets, saying I need to have loaders configured for those file types. If I try adding direct alias references to the pre-compiled Cesium.js scripts under node_modules/cesium/Build and labeling them as “noParse”, it gives errors regarding Knockout’s use of require() in the bundled versions (per the Webpack docs, scripts added to “noParse” are not allowed to use require().

So… is anyone else out there actually using Cesum with Webpack yet, and if so, any tips or suggestions for how to set things up nicely?

To follow up on this, there was some additional discussion an earlier thread ( https://groups.google.com/d/topic/cesium-dev/fH3oiHZnHgE/discussion ) that I apparently skimmed over too much. There’s also discussion in the Cesium issue regarding prepping for NPM ( https://github.com/AnalyticalGraphicsInc/cesium/issues/2981 ), and that led to me a very useful tutorial at https://github.com/mmacaula/cesium-webpack . TL;DR: go with the pre-built version, and do that by using the “script” loader. I also had to use the “exports” loader to tell Webpack to use “window.Cesium” as the exported value of the module.

I have at least managed to successfully load the basic Cesium viewer into my test page. Still working my way through some assorted issues, including a number of warnings about scripts not being allowed to run in Webpack-Dev-Server’s iframe, but some progress.