Files
yawn/vite.config.js
T
Akash Shakdwipeea 3b81926ae1 use channels for comms (#9)
this  refactors the app setup and messaging modules
2025-08-20 21:58:09 +05:30

49 lines
1012 B
JavaScript

import { defineConfig } from "vite";
import wasm from "vite-plugin-wasm";
export default defineConfig({
build: {
rollupOptions: {
input: {
app: "static/index.html",
},
},
// Relative to 'root'.
outDir: "../dist",
copyPublicDir: true,
},
// For getting out of index.html from dist/static directory.
root: "static",
publicDir: ".",
worker: {
format: "es",
},
resolve: {
alias: {
'pkg': 'pkg'
}
},
plugins: [
// Makes us be able to use top level await for wasm.
// Otherwise, we can restrict build.target to 'es2022', which allows top level await.
wasm(),
],
server: {
port: 8080,
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
fs: {
strict: false,
},
},
preview: {
port: 8080,
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
},
});