serve frontend + backend as a one binary
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import path from 'node:path';
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
|
||||
const webDir = path.resolve('.', 'web');
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
@@ -9,16 +7,15 @@ const config = {
|
||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||
adapter: adapter(),
|
||||
files: {
|
||||
appTemplate: path.resolve(webDir, 'app.html'),
|
||||
routes: path.resolve(webDir, 'routes'),
|
||||
lib: path.resolve(webDir, 'lib'),
|
||||
assets: path.resolve(webDir, 'public')
|
||||
appTemplate: "web/app.html" ,
|
||||
routes: "web/routes",
|
||||
lib: "web/lib",
|
||||
assets: "public/lib"
|
||||
},
|
||||
alias: {
|
||||
$image: path.resolve(webDir, 'assets', 'image'),
|
||||
$svg: path.resolve(webDir, 'assets', 'svg')
|
||||
$image: "web/assets/image",
|
||||
$svg: "web/assets/svg"
|
||||
},
|
||||
paths: {
|
||||
assets: process.env.ASSETS_HOST ?? ''
|
||||
@@ -28,8 +25,8 @@ const config = {
|
||||
pollInterval: 1000 * 60 * 1 // 5 minutes
|
||||
},
|
||||
adapter: adapter({
|
||||
pages: path.resolve(webDir, 'public', 'build'),
|
||||
assets: path.resolve(webDir, 'public', 'build'),
|
||||
pages: "web/public/build",
|
||||
assets: "web/public/build",
|
||||
fallback: 'fallback.html',
|
||||
strict: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user