-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
54 lines (53 loc) · 1.37 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
/// <reference types="vitest" />
import react from '@vitejs/plugin-react-swc'
import svgr from 'vite-plugin-svgr'
import postcssNesting from 'postcss-nesting'
import path from 'node:path'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import 'dotenv/config'
import appManifest from './config/app-manifest'
import iconLoader from './utils/vite-icon-loader'
import fontLoader from './utils/vite-font-loader'
import fonts from './src/styles/google-fonts'
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src/components'),
'@asset': path.resolve(__dirname, './src/assets'),
'@sb': path.resolve(__dirname, './.storybook'),
},
},
plugins: [
react(),
svgr(),
fontLoader(fonts),
iconLoader(),
VitePWA({
includeAssets: ['app-icons/favicon.svg'],
registerType: 'autoUpdate',
strategies: 'generateSW',
manifest: appManifest,
...(process.env.SW_DEV === 'true'
? {
devOptions: {
enabled: true,
type: 'module',
},
}
: null),
}),
],
test: {
environment: 'jsdom',
globals: true,
setupFiles: './setupTests.ts',
exclude: ['playwright/tests/**', '**/node_modules/**'],
},
css: {
postcss: {
plugins: [postcssNesting],
},
},
})