Skip to content

Commit

Permalink
Merge pull request #31 from lightning-js/fix/boilerplate-paths
Browse files Browse the repository at this point in the history
Fixes path resolution in the boilerplate code for subfolder deployment
  • Loading branch information
michielvandergeest authored Jan 15, 2024
2 parents 598d7a1 + 83dc2f4 commit 5aacda9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion boilerplate/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.js"></script>
<script type="module" src="src/index.js"></script>
</body>
</html>
20 changes: 17 additions & 3 deletions boilerplate/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
})
1 change: 1 addition & 0 deletions boilerplate/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 5aacda9

Please sign in to comment.