-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
42 lines (40 loc) · 994 Bytes
/
vite.config.ts
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
40
41
42
/// <reference types="vitest/config" />
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { VitePWA } from 'vite-plugin-pwa';
import * as manifest from './src/manifest.json';
import { version } from './package.json';
import * as path from 'path';
import { env } from 'process';
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@components': path.resolve(__dirname, './src/components'),
'@lib': path.resolve(__dirname, './src/lib'),
'@stores': path.resolve(__dirname, './src/stores'),
},
},
server: {
port: 3000,
},
plugins: [
svelte(),
VitePWA({
includeAssets: ['favicon.ico', 'favicon.svg', 'apple-icon-180.png'],
manifest: manifest,
}),
],
base: './',
define: {
__APP_VERSION_STRING__: JSON.stringify(
env.GITHUB_SHA
? `Commit: ${process.env.GITHUB_SHA} (v${version})`
: `Version: ${version}`,
),
},
test: {
globals: true,
environment: 'jsdom',
},
});