-
Notifications
You must be signed in to change notification settings - Fork 12
/
vite.config.ts
64 lines (63 loc) · 1.36 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
import inject from '@rollup/plugin-inject';
import react from '@vitejs/plugin-react';
import * as fs from 'fs';
import path from 'path';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import svgr from 'vite-plugin-svgr';
import topLevelAwait from 'vite-plugin-top-level-await';
import wasm from 'vite-plugin-wasm';
// https://vitejs.dev/config/
export default defineConfig({
// This changes the output dir from dist to build
// comment this out if that isn't relevant for your project
build: {
outDir: 'build',
rollupOptions: {
plugins: [inject({ Buffer: ['buffer', 'Buffer'], process: 'process' })],
},
},
plugins: [
react({
babel: {
plugins: ['macros'],
},
}),
checker({
typescript: true,
eslint: {
lintCommand: 'eslint --ext .js,.ts,.tsx src',
},
}),
wasm(),
topLevelAwait(),
svgr({ svgrOptions: { icon: true } }),
],
resolve: {
alias: [
{
find: /^~(.*)$/,
replacement: '$1',
},
{
find: /@fleet-sdk\/common/,
replacement: path.resolve(
__dirname,
'node_modules',
'@fleet-sdk',
'common',
),
},
],
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
},
},
},
server: {
port: 3000,
},
});