From 83dc2f4d448fbdc5ee3ea0951f5a58bf4e314efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Aslan?= Date: Fri, 12 Jan 2024 21:32:12 +0100 Subject: [PATCH] converts static paths into relative paths for boilerplate --- boilerplate/index.html | 2 +- boilerplate/src/index.js | 20 +++++++++++++++++--- boilerplate/vite.config.js | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/boilerplate/index.html b/boilerplate/index.html index 3f105ca9..614c2fa9 100644 --- a/boilerplate/index.html +++ b/boilerplate/index.html @@ -6,6 +6,6 @@
- + diff --git a/boilerplate/src/index.js b/boilerplate/src/index.js index bc641dfb..0368e202 100644 --- a/boilerplate/src/index.js +++ b/boilerplate/src/index.js @@ -11,8 +11,22 @@ Blits.Launch(App, 'app', { debugLevel: 1, fontLoader: fontLoader, fonts: [ - {family: 'lato', type: 'msdf', png: '/fonts/Lato-Regular.msdf.png', json: '/fonts/Lato-Regular.msdf.json'}, - {family: 'raleway', type: 'msdf', png: '/fonts/Raleway-ExtraBold.msdf.png', json: '/fonts/Raleway-ExtraBold.msdf.json'}, - {family: 'opensans', type: 'web', file: '/fonts/OpenSans-Medium.ttf'} + { + family: 'lato', + type: 'msdf', + png: 'fonts/Lato-Regular.msdf.png', + json: 'fonts/Lato-Regular.msdf.json', + }, + { + family: 'raleway', + type: 'msdf', + png: 'fonts/Raleway-ExtraBold.msdf.png', + json: 'fonts/Raleway-ExtraBold.msdf.json', + }, + { + family: 'opensans', + type: 'web', + file: 'fonts/OpenSans-Medium.ttf', + }, ], }) diff --git a/boilerplate/vite.config.js b/boilerplate/vite.config.js index 9d67b443..f5111e5e 100644 --- a/boilerplate/vite.config.js +++ b/boilerplate/vite.config.js @@ -3,6 +3,7 @@ import blitsVitePlugins from '@lightningjs/blits/vite' export default defineConfig(({ command, mode, ssrBuild }) => { return { + base: '/', // Set to your base path if you are deploying to a subdirectory (example: /myApp/) plugins: [...blitsVitePlugins], resolve: { mainFields: ['browser', 'module', 'jsnext:main', 'jsnext'],