This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
92 lines (90 loc) · 2.39 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
89
90
91
92
import basicSsl from '@vitejs/plugin-basic-ssl';
import react from '@vitejs/plugin-react';
import { config } from 'dotenv';
import { splitVendorChunkPlugin } from 'vite';
import { ViteEjsPlugin } from 'vite-plugin-ejs';
import { VitePWA } from 'vite-plugin-pwa';
import svgr from 'vite-plugin-svgr';
import { defineConfig } from 'vitest/config';
config();
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
basicSsl(),
ViteEjsPlugin((viteConfig) => ({
env: viteConfig.env,
})),
react(),
svgr({}),
splitVendorChunkPlugin(),
VitePWA({
registerType: 'autoUpdate',
injectRegister: null,
workbox: {
globPatterns: ['**/*.{js,css,html,woff,woff2,svg}'],
navigateFallbackDenylist: [/^\/backend/],
},
includeAssets: [
'/favicon.ico',
'/favicon.svg',
'/android-chrome-192x192.png',
'/android-chrome-512x512.png',
'/mstile-150x150.png',
'/safari-pinned-tab.svg',
'/apple-touch-icon.png',
'/apple-touch-icon-precomposed.png',
],
manifest: {
theme_color: '#f5f5f5',
background_color: '#f5f5f5',
icons: [
{
src: '/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: '/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png',
},
],
orientation: 'any',
display: 'standalone',
lang: 'ru-RU',
start_url: process.env.VITE_APP_BASE_URL ?? '/',
name: 'Найди IT-проект | Sapphire',
short_name: 'Найди IT-проект',
description: 'Помогает специалистам объединиться в команды для работы в проектах',
},
}),
],
test: {
globals: true,
environment: 'jsdom',
setupFiles: 'tests/config/setup.ts',
include: ['(src|tests)/**/*.test.ts(x)?'],
cache: {
dir: '.yarn/.vite/test',
},
},
server: {
https: true,
proxy: {
'/backend': {
target: process.env.VITE_API_BASE_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/backend/, ''),
},
},
},
cacheDir: '.yarn/.vite',
resolve: {
alias: [
{
find: /^~\//,
replacement: '/src/',
},
],
},
});