-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
87 lines (84 loc) · 2.16 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
import { defineConfig, createLogger } from 'vite'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'
import wyw from '@wyw-in-js/vite'
import checker from 'vite-plugin-checker'
import { VitePWA } from 'vite-plugin-pwa'
import EnvironmentPlugin from 'vite-plugin-environment'
const customLogger = createLogger()
const loggerWarn = customLogger.warn
customLogger.warn = (msg, options) => {
if (msg.includes('vite:css') && msg.includes('@import must precede all other statements')) return
loggerWarn(msg, options)
}
export default defineConfig(({ mode }) => ({
plugins: [
react(),
svgrPlugin(),
wyw({
include: ['**/*.{ts,tsx}'],
babelOptions: {
presets: ['@babel/preset-typescript', '@babel/preset-react'],
},
}),
mode === 'development' &&
checker({
typescript: true,
overlay: false,
eslint: {
lintCommand: 'eslint "./src/**/*.{ts,tsx}"',
},
}),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['assets/favicon.ico'],
manifest: {
start_url: '/',
name: 'Reapit Contact App',
short_name: 'Contact',
description: 'Contact app for Reapit Foundatioms',
theme_color: '#fff',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-152x152.png',
sizes: '152x152',
type: 'image/png',
},
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
purpose: 'any maskable',
},
],
},
}),
EnvironmentPlugin({
APP_ENV: 'local',
CONNECT_CLIENT_ID: '',
CONNECT_USER_POOL_ID: 'eu-west-2_eQ7dreNzJ',
CONNECT_OAUTH_URL: 'https://connect.reapit.cloud',
PLATFORM_API_URL: 'https://platform.reapit.cloud',
}),
],
build: {
outDir: 'build',
rollupOptions: {
output: {
manualChunks: {
elements: ['@reapit/elements'],
},
},
},
},
server: {
host: true,
port: 8080,
},
customLogger,
}))