feat: Add subdirectory hosting support and fix asset path resolution

- Update README with comprehensive subdirectory hosting instructions and BASE_URL configuration guide
- Convert absolute asset paths to relative paths in index.html for proper subdirectory deployment
- Update all worker script imports to use relative paths instead of absolute paths
- Fix favicon and image references to work correctly when hosted in nested directories
- Normalize whitespace and formatting across worker files for consistency
- Update vite.config.ts to properly handle BASE_URL configuration for subdirectory deployments
- Ensure all tool pages and logic files maintain compatibility with subdirectory hosting
- Enable BentoPDF to be deployed at any URL path (e.g., example.com/tools/bentopdf/) without breaking asset loading
This commit is contained in:
abdullahalam123
2025-12-04 23:53:00 +05:30
parent 19425d98f9
commit b279c05281
39 changed files with 206 additions and 181 deletions

View File

@@ -2,7 +2,7 @@ import JSZip from 'jszip'
import { downloadFile, formatBytes, readFileAsArrayBuffer } from '../utils/helpers';
import { initializeGlobalShortcuts } from '../utils/shortcuts-init.js';
const worker = new Worker(new URL('/workers/pdf-to-json.worker.js', import.meta.url));
const worker = new Worker(import.meta.env.BASE_URL + 'workers/pdf-to-json.worker.js');
let selectedFiles: File[] = []
@@ -144,7 +144,7 @@ worker.onmessage = async (e: MessageEvent) => {
if (backToToolsBtn) {
backToToolsBtn.addEventListener('click', () => {
window.location.href = '/'
window.location.href = import.meta.env.BASE_URL
})
}