-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
62 lines (60 loc) · 1.71 KB
/
Copy pathvite.config.ts
File metadata and controls
62 lines (60 loc) · 1.71 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import path from 'path';
import tailwindcss from '@tailwindcss/vite';
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import { tanstackRouter } from '@tanstack/router-plugin/vite';
import { VitePWA } from 'vite-plugin-pwa';
const PWA_THEME_COLOR = '#d40924';
const PWA_BACKGROUND_COLOR = '#ffffff';
const BASE_PATH = process.env.GITHUB_ACTIONS ? '/music-tools/' : '/';
// https://vite.dev/config/
export default defineConfig({
base: BASE_PATH,
plugins: [
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
react(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'pwa-icons/apple-touch-icon.png'],
manifest: {
name: 'Music Tools',
short_name: 'Music Tools',
description: 'An all-in-one music toolkit with essential tools today.',
theme_color: PWA_THEME_COLOR,
background_color: PWA_BACKGROUND_COLOR,
display: 'standalone',
id: BASE_PATH,
start_url: BASE_PATH,
scope: BASE_PATH,
icons: [
{
src: 'pwa-icons/pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-icons/pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-icons/pwa-maskable-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
},
],
},
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
test: {
environment: 'node',
include: ['tests/**/*.spec.ts', 'tests/**/*.test.ts'],
},
});