-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.ts
41 lines (40 loc) · 1.26 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
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import windiCSS from 'vite-plugin-windicss'
import tsConfigPath from 'vite-tsconfig-paths'
export default defineConfig(
env => ({
plugins: [
// only use react-fresh
env.mode === 'development' && react(),
tsConfigPath(),
windiCSS(),
VitePWA({
injectRegister: 'inline',
manifest: {
icons: [{
src: '//cdn.jsdelivr.net/gh/Dreamacro/clash-dashboard/src/assets/Icon.png',
sizes: '512x512',
type: 'image/png',
}],
start_url: '/',
short_name: 'Clash Dashboard',
name: 'Clash Dashboard',
},
}),
],
base: './',
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "sass:math"; @import "src/styles/variables.scss";',
},
},
},
build: { reportCompressedSize: false },
esbuild: {
jsxInject: "import React from 'react'",
},
}),
)