-
Notifications
You must be signed in to change notification settings - Fork 6
/
vite.config.js
42 lines (40 loc) · 1021 Bytes
/
vite.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
36
37
38
39
40
41
42
import { defineConfig } from 'vite';
import { splitVendorChunkPlugin } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import { version } from './package.json';
process.env.REACT_APP_VERSION = version;
export default defineConfig({
plugins: [
react(),
splitVendorChunkPlugin(),
VitePWA({
strategies: 'injectManifest',
filename: 'service-worker.js',
manifest: {
short_name: '树洞社区版',
name: 'P大树洞社区版',
icons: [
{
src: 'static/favicon/256.png',
sizes: '256x256',
type: 'image/png',
},
{
src: 'static/favicon/192.png',
sizes: '192x192',
type: 'image/png',
},
],
start_url: '.',
display: 'standalone',
theme_color: '#333333',
background_color: '#333333',
},
}),
],
envPrefix: 'REACT_APP_',
build: {
outDir: 'build',
},
});