forked from miaklwalker/Blueprint
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
38 lines (38 loc) · 800 Bytes
/
vite.config.js
File metadata and controls
38 lines (38 loc) · 800 Bytes
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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
{
name: 'wasm-mime',
configureServer(server) {
server.middlewares.use((req, res, next) => {
if (req.url?.endsWith('.wasm')) res.setHeader('Content-Type', 'application/wasm');
next();
});
}
}
],
base: process?.env?.BASE_PATH || './',
server: {
port: 3141,
host: true,
cors: true,
allowedHosts: ['*.8pi.me*', 'motelyjaml-pi.8pi.me'],
},
preview: {
port: 3000,
host: true,
},
optimizeDeps: {
exclude: ['motely-wasm'],
},
assetsInclude: ['**/*.wasm'],
build: {
target: 'esnext',
},
ssr: {
noExternal: ['motion']
}
})