fix: host app with subpath (#11739)

closes #11719
This commit is contained in:
forehalo
2025-04-17 01:29:48 +00:00
parent 268c34e8b5
commit 18fae0f1aa
6 changed files with 13 additions and 6 deletions

View File

@@ -16,8 +16,10 @@ export function setupGlobal() {
isPwa: false,
isMobile: false,
isSelfHosted: false,
// publicPath is the root of assets files
publicPath: '/',
workerPath: '/js/',
// subPath is the path to access the affine service
subPath: '',
};
if (globalThis.navigator) {

View File

@@ -1,5 +1,7 @@
export function getWorkerUrl(name: string) {
return (
environment.workerPath + `${name}-${BUILD_CONFIG.appVersion}.worker.js`
environment.publicPath +
'js/' +
`${name}-${BUILD_CONFIG.appVersion}.worker.js`
);
}