CesiumGS / cesium-webpack-example

The minimal recommended setup for an application using Cesium with Webpack.
Apache License 2.0
243 stars 160 forks source link

Cesium definitely doesn't work with ES6 !!! #31

Open Mr-Lion opened 2 years ago

Mr-Lion commented 2 years ago

Hi,

Although it is advertised here and on the Cesium homepage that Cesium now supports ES6, this is not entirely true. ES6 was not implemented directly in order to only use "import" and "export" functions.

Have you ever tried to use "await" and "async"? You will immediately notice that "await" is marked as an error, because the whole thing runs as "COMMONJS" and it is not supported by it.

I noticed that in which I wanted to use Promise in my Typescript and therefore cannot use "await" at all. As a result, asynchronous use is denied to me. I was told that in my tsconfig.json file I would have to change the module to, for example, "esNext" and the "target" to at least 2017. As soon as I do that, all of the Cesium code stops working. The script from me doesn't know either "Viewer" or "ION" as an example.

Since the "Promise" functionality is very important, I ask for urgent help and support in converting this to ES6 or higher.

Thank you in advance for the trouble.

Many greetings