diablo2-web/vite.config.ts

36 lines
1.2 KiB
TypeScript

import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vite'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
/**
* The engine is plain TypeScript with no runtime dependencies: Vite only serves
* and bundles it. Four entries: the asset inspector (`index.html`), the walkable
* scene (`walk.html`), the two-player co-op scene (`net.html`) and the real
* campaign scene (`acts.html`). `samples/` is served in dev so all of them can
* be smoke-tested over HTTP (`?sample=samples/spawn.mpq`,
* `?data=samples/fixtures`).
*/
export default defineConfig({
server: {
host: '127.0.0.1',
port: 5173,
strictPort: true,
},
build: {
target: 'es2022',
sourcemap: true,
rollupOptions: {
input: {
index: new URL('./index.html', import.meta.url).pathname,
walk: new URL('./walk.html', import.meta.url).pathname,
net: new URL('./net.html', import.meta.url).pathname,
acts: new URL('./acts.html', import.meta.url).pathname,
arena: new URL('./arena.html', import.meta.url).pathname,
loot: resolve(__dirname, 'loot.html'),
},
},
},
})