-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsvelte.config.js
More file actions
39 lines (35 loc) · 1.08 KB
/
svelte.config.js
File metadata and controls
39 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import child_process from 'child_process';
import { readFileSync } from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import externalLink from '@svelte-put/preprocess-external-link';
import adapter from '@sveltejs/adapter-cloudflare';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
const commitHash = child_process.execSync('git rev-parse --short HEAD').toString().trim();
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: [externalLink(['quansat.dev']), vitePreprocess()],
kit: {
prerender: {
origin: 'https://quansat.dev',
},
adapter: adapter({
routes: {
include: ['/*'],
exclude: ['<all>'],
},
platformProxy: {
configPath: path.resolve(__dirname, './wrangler.toml'),
},
}),
version: {
name: `${pkg.version} (#${commitHash}@${Date.now()})`,
},
alias: {
$routes: path.resolve(__dirname, 'src/routes'),
},
},
};
export default config;