I would like to host a SvelteKit project on GitHub pages but apparently I haven't found the right settings yet. I tried
import adapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
pages: 'build',
assets: 'build',
fallback: null,
precompress: false
}),
appDir: 'app',
prerender: {
default: true,
},
trailingSlash: 'always',
}
};
export default config;
- The
trailingSlashoption is mentioned by the SvelteKit docs - Removed
_from the defaultappDir: '_app'because it was mentioned somewhere that it might cause problems because of jekyll. This step should be unnecessary if an empty.nojekyllfile is added to the project (not sure if to the absolute root of the project or in the folder that's hosted) Either way I saw no difference
When running preview after building everything looks fine. But when opening the deployed page all the .css and .js files have a 404 status. Which setting am I missing?