-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
40 lines (35 loc) · 925 Bytes
/
vite.config.js
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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
const config = {
development: {
entry: resolve(__dirname, 'src/index.development.ts'),
name: 'character-vault-foundry.development',
fileName: 'character-vault-foundry.development',
},
production: {
entry: resolve(__dirname, 'src/index.production.ts'),
name: 'character-vault-foundry.production',
fileName: 'character-vault-foundry.production',
},
};
const currentConfig = config[process.env.NODE_ENV];
if (currentConfig === undefined) {
throw new Error('NODE_ENV is not defined or is not valid');
}
// https://vitejs.dev/guide/build.html#library-mode
export default defineConfig({
plugins: [
checker({
typescript: true,
}),
],
build: {
minify: false,
emptyOutDir: false,
lib: {
...currentConfig,
formats: ['cjs'],
},
},
});