How did you install Cesium in this framework? If you manually placed the folder in there, you might just be missing the Source/ThirdParty folder, which is where I can see the purify.js file is.
Otherwise, there is a Cesium npm package that might make it easier to set it up here:
So I referenced the cesium node_modules directory.
Next what I tried using babel to transpile the Cesium modules from AMD to CommonJS. This got me far enough to import cesium modules using import statements, However, when I run methods I get errors such as:
TypeError: _Cartesian.default.fromDegreesArray is not a function
or
TypeError: _PolygonHierarchy.default is not a constructor
That’s odd. I do know we have projects that rely on importing Cesium as an npm package. For example, gltf-pipeline is both a library and a commandline tool that includes it this way:
The code we are testing uses es6 import statements, we won’t be able to modify our code around the tests.
I did try using require as an import statement, but got errors “define is not defined”. That error happens because Jest doesn’t support requirejs or AMD modules.
Transpiling the cesum modules to commonjs using babel results in the TypeError errors.
The modules will look like this after the transpiling
ReferenceError: requirejsVars is not defined
at exec (node_modules/requirejs/bin/r.js:62:23)
at setBaseUrl (node_modules/requirejs/bin/r.js:30248:13)
at node_modules/requirejs/bin/r.js:30338:9
at Object.<anonymous> (node_modules/requirejs/bin/r.js:30427:2)
at Object.<anonymous> (node_modules/cesium/index.js:13:17)
I understand that my use of Webpack and Resium make my issue more complicated, but I am fairly certain that the resolution to my issue will be relevant to Brian’s.
If I am way off base here, I will apologetically move my query to a separate thread.
Any help would be appreciated. Thank you for your time.