forked from joelface/bg1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mts
53 lines (51 loc) · 1.05 KB
/
vite.config.mts
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
import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig } from 'vite';
import obfuscatorPlugin from 'vite-plugin-javascript-obfuscator';
const server = {
host: '0.0.0.0',
port: 3000,
https: {
cert: './tls/dev.cert',
key: './tls/dev.key',
},
};
export default defineConfig({
base: '/bg1/',
root: 'src',
resolve: {
alias: {
'@/': path.join(__dirname, 'src') + '/',
},
},
build: {
outDir: '../dist',
emptyOutDir: false,
rollupOptions: {
input: ['src/bg1.tsx', 'src/bg1.css', 'src/responder.html'],
output: {
entryFileNames: '[name].js',
chunkFileNames: '[name].js',
assetFileNames: '[name][extname]',
},
},
},
esbuild: {
charset: 'ascii',
},
server,
preview: server,
plugins: [
react(),
obfuscatorPlugin({
include: ['src/api/diu/*'],
apply: 'build',
options: {
seed: 1,
splitStrings: true,
stringArrayThreshold: 1,
stringArrayEncoding: ['base64'],
},
}),
],
});