27 lines
1.0 KiB
JavaScript
27 lines
1.0 KiB
JavaScript
import { resolve } from 'node:path';
|
|
import { defineConfig } from 'vite';
|
|
import { freeMocapBridge } from './tools/freemocap-vite-plugin.mjs';
|
|
|
|
export default defineConfig({
|
|
plugins: [freeMocapBridge({ projectRoot: import.meta.dirname })],
|
|
server: { port: 5174, open: true },
|
|
// Multi-page: main game + character studio both ship as real HTML entries.
|
|
build: {
|
|
target: 'es2022',
|
|
// The body/skin generators are one deterministic chunk; splitting them buys
|
|
// nothing and costs a round trip before anything can render.
|
|
chunkSizeWarningLimit: 2500,
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(import.meta.dirname, 'index.html'),
|
|
character: resolve(import.meta.dirname, 'character.html'),
|
|
animation: resolve(import.meta.dirname, 'animation.html'),
|
|
},
|
|
},
|
|
},
|
|
// box3d.js ships an Emscripten bundle that resolves its .wasm via
|
|
// import.meta.url. Pre-bundling rewrites that URL and breaks the lookup, so
|
|
// leave it alone.
|
|
optimizeDeps: { exclude: ['box3d.js'] },
|
|
});
|