I have a sample app at my-vue-app which demonstrates the problem.
The app builds and starts to run, but I get a lot of errors like:
Resource.js:2256 GET http://localhost:5173/Assets/approximateTerrainHeights.json 404 (Not Found)
bingAerial.png:1 GET http://localhost:5173/Widgets/Images/ImageryProviders/bingAerial.png 404 (Not Found)
TouchRotate.svg:1 GET http://localhost:5173/Widgets/Images/NavigationHelp/TouchRotate.svg 404 (Not Found)
Resource.js:2256 GET http://localhost:5173/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg 404 (Not Found)
The "Configuring CESIUM_BASE_URL" section at CesiumJS Quickstart says:
Configure your module bundler to copy the following four directories and serve them as static files
Based on this information, I added to main.js:
window.CESIUM_BASE_URL = '';
and changed vite.config.js to:
import { defineConfig } from 'vite'
import { join } from 'path';
import serveStatic from 'serve-static';
import path from 'path';
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue()
],
server: {
middleware: [
serveStatic(join(__dirname, 'node_modules', 'cesium', 'Build', 'Cesium'))
]
}
})
Unfortunately, the behavior did not change.
I am not sure what more I need to do to make this work.
Does anyone have any advice?