Thanks for the quick and detailed response Kevin. I definitely feel a lot better about using your fork, but I would argue that perhaps its best to get your changes into the main cesium repo. IMHO, npm/browserify/webpack are definitely getting a lot of interest in the community and having Cesium work with all of them out of the box would be ideal.
To those who do come across this thread, there are currently three main errors that Nick mentioned above:
WARNING in ./Source/Core/buildModuleUrl.js
Critical dependencies:
47:15-22 require function is used in a way, in which dependencies cannot be statically extracted
67:24-31 require function is used in a way, in which dependencies cannot be statically extracted
@ ./Source/Core/buildModuleUrl.js 47:15-22 67:24-31
WARNING in ./Source/ThirdParty/knockout-3.2.0.js
Critical dependencies:
19:128-135 require function is used in a way, in which dependencies cannot be statically extracted
@ ./Source/ThirdParty/knockout-3.2.0.js 19:128-135
WARNING in ./Source/Core/TaskProcessor.js
Critical dependencies:
124:27-34 require function is used in a way, in which dependencies cannot be statically extracted
@ ./Source/Core/TaskProcessor.js 124:27-34
Both TaskProcessor and BuildModuleUrl errors are safe to ignore if you are using webpack, as the warning areas are really just checking to see if require
is the AMD require and if not they default to using the baseUrl that you can config using Kevin’s instructions, #3 above (buildModuleUrl.setBaseUrl(‘./Cesium/build/’)
The Knockout errors are due to a current (fixed) bug in knockout 3.2.0 with how they defined their module wrapper code. Forcing the knockout code in my cesium distribution to be 3.3.0 fixed that error completely. Still, I believe that this warning can be safely ignored as well because it is in the code that’s checking for AMD require, and doesn’t do anything crazy with it if it doesn’t find it. Webpack just doesn’t know this and complains.
However, webpack does still complain about the BuildModuleUrl. I found a bazooka method to remove those errors, I’m still learning Webpack but if you configure the ‘module’ has with the code below, it instructs webpack to ignore all those require errors. I call this a bazooka because as far as I can tell, it will ignore all errors wherever they may be, safe or not to ignore. So be warned. If I find another, better way, I’ll post it.
In the ‘module’ section of your webpack config, place the following line:
// rest of config
module : {
unknownContextCritical : false,
// rest of your loaders
}
``
Hope that helps! And double thanks to Kevin for doing all the real work!