forked from eXaminator/kanka-foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
43 lines (41 loc) · 1.2 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
import { resolve } from 'path';
import type { UserConfig } from 'vite';
import hbsPlugin from './build/hbsPlugin';
import translationPlugin from './build/translationPlugin';
const config: UserConfig = {
root: resolve(__dirname, 'src/devServer'),
publicDir: resolve(__dirname, 'public'),
base: '/modules/kanka-foundry/',
server: {
port: 3000,
open: false,
proxy: {
'^(?!/modules/kanka-foundry)': 'http://localhost:30000/',
'^/modules/kanka-foundry/lang': '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('./src/lang', './dist/lang'),
],
};
export default config;