From 82fd3d4fec286ed7cbdf987ad809c77a4e12a0da Mon Sep 17 00:00:00 2001 From: allyoucanmap Date: Tue, 3 Dec 2024 16:02:27 +0100 Subject: [PATCH] Fix #10709 Allow to set the CESIUM_BASE_URL dynamically --- build/buildConfig.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/build/buildConfig.js b/build/buildConfig.js index 9200c81061..de3ab58d7a 100644 --- a/build/buildConfig.js +++ b/build/buildConfig.js @@ -166,10 +166,13 @@ module.exports = (...args) => mapArgumentsToObject(args, ({ }), new DefinePlugin({ '__MAPSTORE_PROJECT_CONFIG__': JSON.stringify(projectConfig) }), VERSION_INFO_DEFINE_PLUGIN, - new DefinePlugin({ - // Define relative base path in cesium for loading assets - 'CESIUM_BASE_URL': JSON.stringify(cesiumBaseUrl ? cesiumBaseUrl : path.join('dist', 'cesium')) - }), + ...(cesiumBaseUrl !== false + ? [ + new DefinePlugin({ + // Define relative base path in cesium for loading assets + 'CESIUM_BASE_URL': JSON.stringify(cesiumBaseUrl ? cesiumBaseUrl : path.join('dist', 'cesium')) + }) + ] : []), new CopyWebpackPlugin([ { from: path.join(getCesiumPath({ paths, prod }), 'Workers'), to: path.join(paths.dist, 'cesium', 'Workers') }, { from: path.join(getCesiumPath({ paths, prod }), 'Assets'), to: path.join(paths.dist, 'cesium', 'Assets') },