-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
vite.config.ts
88 lines (83 loc) · 2.03 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { VitePWA } from 'vite-plugin-pwa'
import postcss from './postcss.config.js'
import { resolve } from 'path'
const banner = `/**
Copyright (c) ${new Date().getFullYear()} Giorgio Bellisario, all rights reserved.
Code released under the MIT license.
Source code available at: https://github.com/Bellisario/musicale
*/`
// https://vitejs.dev/config/
export default defineConfig({
esbuild: {
// prevent Microsoft banner from being added to the bundle
legalComments: 'none',
// add custom banner
banner,
},
build: {
outDir: './dist/public',
},
plugins: [svelte({
compilerOptions: {
cssHash: ({ hash, css }) => `s-${hash(css)}`,
},
}), VitePWA({
manifest: {
name: 'Musicale',
short_name: 'Musicale',
theme_color: '#ff9900',
background_color: '#2c2a2a',
description: 'Musicale, a music streaming service with style.',
icons: [
{
src: 'favicon_60x.png',
sizes: '60x60',
type: 'image/png'
},
{
src: 'favicon_120x.png',
sizes: '120x120',
type: 'image/png'
},
{
src: 'favicon_180x.png',
sizes: '180x180',
type: 'image/png'
},
{
src: 'favicon.svg',
sizes: '512x512',
type: 'image/svg+xml'
},
]
},
includeAssets: [
"./fonts/*",
"./logo.svg",
],
workbox: {
navigateFallbackDenylist: [
// don't cache robots.txt and sitemap.xml
/robots\.txt$/,
/sitemap\.xml$/,
]
},
devOptions: {
// enabled: true,
},
})],
css: {
postcss,
},
resolve: {
alias: {
$assets: resolve(__dirname, "./src/assets"),
$lib: resolve(__dirname, "./src/lib"),
$components: resolve(__dirname, "./src/components"),
$types: resolve(__dirname, "./src/types"),
$store: resolve(__dirname, "./src/lib/store.ts"),
},
},
})