forked from MisterPrada/singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
60 lines (56 loc) · 1.76 KB
/
vite.config.js
File metadata and controls
60 lines (56 loc) · 1.76 KB
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
import restart from 'vite-plugin-restart'
import glsl from 'vite-plugin-glsl'
import basicSsl from '@vitejs/plugin-basic-ssl'
import path from 'path'
import Terminal from 'vite-plugin-terminal'
//import obfuscatorPlugin from "vite-plugin-javascript-obfuscator";
const dirname = path.resolve()
const isCodeSandbox = 'SANDBOX_URL' in process.env || 'CODESANDBOX_HOST' in process.env
export default ({ mode }) => ({
root: 'src/',
publicDir: '../static/',
base: './',
resolve:
{
alias:
{
'@experience' : path.resolve(dirname, './src/Experience/'),
}
},
server:
{
host: true,
open: !isCodeSandbox, // Open if it's not a CodeSandbox
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
},
},
build:
{
outDir: '../dist',
emptyOutDir: true,
sourcemap: mode !== 'production'
},
plugins:
[
restart({ restart: [ '../static/**', ] }), // Restart server on static file change
glsl(),
basicSsl(),
// Terminal({
// console: 'terminal',
// output: ['terminal', 'console']
// })
// obfuscatorPlugin({
// options: {
// //include: ["src/path/to/file.js", "path/anyjs/**/*.js", /foo.js$/],
// exclude: [/node_modules/],
// apply: "build",
// debugger: true,
// // your javascript-obfuscator options
// debugProtection: true,
// // ... [See more options](https://github.com/javascript-obfuscator/javascript-obfuscator)
// },
// }),
]
})