Skip to content

Commit 8e9eecb

Browse files
committed
wip
1 parent 849d21c commit 8e9eecb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

meteor/server/api/rest/koa.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Meteor.startup(() => {
8383
const webuiServer = staticServe(public_dir, {
8484
index: false, // Performed manually
8585
})
86-
koaApp.use(KoaMount(getRootSubpath(), webuiServer))
86+
koaApp.use(KoaMount(getRootSubpath() || '/', webuiServer))
8787
logger.debug(`Serving static files from ${public_dir}`)
8888

8989
if (Meteor.isDevelopment) {

packages/webui/src/client/ui/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { DocumentTitleProvider } from '../lib/DocumentTitleProvider'
3939
import { catchError, firstIfArray, isRunningInPWA } from '../lib/lib'
4040
import { protectString } from '@sofie-automation/shared-lib/dist/lib/protectedString'
4141
import { useUserPermissions, UserPermissionsContext } from './UserPermissions'
42-
import { ROOT_URL_PATH_PREFIX } from '../url'
42+
import { relativeToSiteRootUrl, ROOT_URL_PATH_PREFIX } from '../url'
4343

4444
const NullComponent = () => null
4545

packages/webui/vite.config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ await Promise.all([
2626
findCommonJsPathsForLibrary('@sofie-automation/meteor-lib/dist', '../meteor-lib/dist'),
2727
])
2828

29-
const basePath = process.env.SOFIE_BASE_PATH || '/'
29+
const basePath = process.env.SOFIE_BASE_PATH || ''
3030

3131
// https://vitejs.dev/config/
3232
export default defineConfig(({ command }) => ({
3333
plugins: [react(), tsconfigPaths(), nodePolyfills()],
3434

3535
// In production, build relative so that paths inside the scss files are correct. This makes a mess in the html, but we can fix that on the fly
3636
// In dev, use the specified base path
37-
base: command === 'build' ? '' : basePath,
37+
base: command === 'build' ? '' : basePath || '/',
3838

3939
optimizeDeps: {
4040
include: [

scripts/run.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function watchMeteor() {
7070
name: "VITE",
7171
prefixColor: "yellow",
7272
env: {
73-
SOFIE_BASE_PATH: rootUrl.pathname.length > 1 ? rootUrl.pathname : '',
73+
SOFIE_BASE_PATH: rootUrl && rootUrl.pathname.length > 1 ? rootUrl.pathname : '',
7474
},
7575
},
7676
];

0 commit comments

Comments
 (0)