diff --git a/src/index.js b/src/index.js index a2b11f7..371a6d7 100644 --- a/src/index.js +++ b/src/index.js @@ -12,16 +12,18 @@ let cameraConfig = null; // Load camera configuration from config file async function loadCameraConfig() { try { - const response = await fetch('camera-config.json'); + const response = await fetch('./camera-config.json'); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } cameraConfig = await response.json(); - console.log('Camera config loaded:', cameraConfig); + console.log('✅ Camera config loaded successfully:', cameraConfig); return cameraConfig; } catch (error) { - console.warn('Could not load camera config, using defaults:', error); - // Return default config if file load fails + console.warn('⚠️ Could not load camera-config.json, using original defaults.'); + console.log('📝 To use custom camera settings, ensure camera-config.json is accessible from your web server.'); + + // Return original simple defaults return { camera: { position: { x: 20, y: 20, z: 20 }, diff --git a/webpack.config.js b/webpack.config.js index 3b069dd..b9a6740 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -57,6 +57,10 @@ module.exports = (env, argv) => { { from: 'cube/', to: 'cube/' + }, + { + from: 'camera-config.json', + to: 'camera-config.json' } ] })