Require() of ES Module for engine/index.js

I am trying to get a downloaded v1.106.0 of Cesium to work with Webpack in our BE node environment. My frontend Angular project builds perfectly, but I’m getting an error message when building: require() of ES Module third_party/cesium/packages/engine/index.js from dist/apps/api/main.js not supported.


“compilerOptions”: {
“outDir”: “…/…/dist/out-tsc”,
“module”: “commonjs”,
“types”: [“node”],
“resolveJsonModule”: true
“paths”: {
@cesiumgs/engine”: [“third_party/cesium/packages/engine”],
@cesiumgs/ion-sdk-widgets”: [“third_party/cesium/packages/ion-sdk-widgets”],
@cesiumgs/widgets”: [“third_party/cesium/packages/widgets”],

I’ve tried adding these to webpack externals and following This tutorial explains how to integrate the Cesium npm module from webpack, and explores more advanced webpack configurations for optimizing an application using CesiumJS. – Cesium, which is what I have for Angular, but always get the same error message. Any ideas what to try?

Hi @moxi,

There is a more up-to-date example at CesiumGS/cesium-webpack-example.