forked from greenbone/gsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
56 lines (54 loc) · 1.27 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
/// <reference types="vitest" />
import path from 'path';
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react';
import legacy from '@vitejs/plugin-legacy';
import svgrPlugin from 'vite-plugin-svgr';
import eslintPlugin from 'vite-plugin-eslint2';
const projectRootDir = path.resolve(__dirname);
// https://vitejs.dev/config/
export default defineConfig({
define: {global: 'window'},
plugins: [
react({include: /\.(mdx|js|jsx|ts|tsx)$/}),
legacy(),
svgrPlugin({
svgrOptions: {
// https://react-svgr.com/docs/options/
icon: true,
},
include: ['**/*.svg?react', '**/*.svg'],
}),
eslintPlugin(),
],
resolve: {
alias: [
{
find: 'gmp',
replacement: path.resolve(projectRootDir, 'src', 'gmp'),
},
{
find: 'web',
replacement: path.resolve(projectRootDir, 'src', 'web'),
},
{
find: 'version',
replacement: path.resolve(projectRootDir, 'src', 'version.js'),
},
{
find: '@gsa/testing',
replacement: path.resolve(projectRootDir, 'src', 'testing.js'),
},
],
},
server: {
port: 8080,
},
build: {
outDir: 'build',
minify: 'terser',
terserOptions: {
mangle: false,
},
},
});