-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvelte.config.js
35 lines (28 loc) · 916 Bytes
/
svelte.config.js
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
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import * as child_process from 'node:child_process';
import * as crypto from 'node:crypto';
const getVersion = () => {
let rev = child_process.execSync('git describe --always --abbrev=0 --dirty').toString().trim();
if (rev.indexOf('-dirty') != -1) {
let data = child_process.execSync('git status --porcelain=2').toString().trim();
rev += '+' + crypto.createHash('sha1').update(data).digest('hex');
}
return rev;
};
/** @type {import('@sveltejs/kit').Config} */
const config = {
preprocess: vitePreprocess(),
kit: {
adapter: adapter({
fallback: 'index.html',
}),
alias: {
'$components': "src/components",
},
version: {
name: getVersion(),
},
},
};
export default config;