-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
vite.config.ts
59 lines (58 loc) · 1.61 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
import { defineConfig } from 'vitest/config';
import { resolve } from 'node:path';
import hbsPlugin from './build/hbsPlugin';
import translationPlugin from './build/translationPlugin';
export default defineConfig({
root: resolve(__dirname, 'src'),
publicDir: resolve(__dirname, 'public'),
base: '/modules/kanka-foundry/',
server: {
port: 3000,
open: false,
proxy: {
'^(?!/modules/kanka-foundry)': 'http://localhost:30000/',
'^/modules/kanka-foundry/lang/.+\.json': 'http://localhost:30000/',
'^/modules/kanka-foundry/templates': 'http://localhost:30000/',
'/socket.io': {
target: 'ws://localhost:30000',
ws: true,
},
},
},
esbuild: {
keepNames: true,
},
build: {
outDir: resolve(__dirname, 'dist'),
emptyOutDir: true,
sourcemap: true,
lib: {
name: 'kanka-foundry',
entry: resolve(__dirname, 'src/index.ts'),
formats: ['es'],
fileName: () => 'index.js',
},
},
plugins: [
hbsPlugin(),
translationPlugin(),
],
test: {
clearMocks: true,
setupFiles: ['./src/setupTests.ts'],
root: resolve(__dirname, 'src'),
globals: true,
coverage: {
all: true,
exclude: [
'types/**',
'index.ts',
'kanka.ts',
'**/*.d.ts',
'**/*.test.ts',
'**/__mocks__/**',
'dev/**',
],
},
},
});