Skip to content

Commit

Permalink
Copy ThirdParty folder to assets as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakarFin committed Nov 4, 2020
1 parent b21cd16 commit 8b3e126
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const getDirectories = source => readdirSync(source).map(name => path.join(sourc

// The path to the CesiumJS source code
const cesiumSource = 'node_modules/cesium/Source';
const cesiumWorkers = '../Build/Cesium/Workers';
const cesiumTarget = 'cesium';

module.exports = (env, argv) => {
const isProd = argv.mode === 'production';
Expand All @@ -37,14 +37,16 @@ module.exports = (env, argv) => {

// Copy Cesium Assets, Widgets, and Workers to a static directory
plugins.push(new CopywebpackPlugin([
{ from: path.join(__dirname, cesiumSource, cesiumWorkers), to: 'cesium/Workers' },
{ from: path.join(__dirname, cesiumSource, 'Assets'), to: 'cesium/Assets' },
{ from: path.join(__dirname, cesiumSource, 'Widgets'), to: 'cesium/Widgets' }
{ from: path.join(__dirname, cesiumSource, '../Build/Cesium/Workers'), to: cesiumTarget + '/Workers' },
{ from: path.join(__dirname, cesiumSource, 'Assets'), to: cesiumTarget + '/Assets' },
{ from: path.join(__dirname, cesiumSource, 'Widgets'), to: cesiumTarget + '/Widgets' },
// copy Cesium's minified third-party scripts
{from: path.join(__dirname, cesiumSource, '../Build/Cesium/ThirdParty'), to: cesiumTarget + '/ThirdParty'},
]));

// Define relative base path in Cesium for loading assets
plugins.push(new DefinePlugin({
CESIUM_BASE_URL: JSON.stringify(`${publicPathPrefix}Oskari/dist/${version}/cesium`)
CESIUM_BASE_URL: JSON.stringify(`${publicPathPrefix}Oskari/dist/${version}/${cesiumTarget}`)
}));

const themeFile = theme ? path.resolve(theme) : path.join(__dirname, 'src/react/ant-theme.less');
Expand Down

0 comments on commit 8b3e126

Please sign in to comment.