diablo2-web/vite.config.ts

38 lines
1.1 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. Two entries: the real campaign scene (`acts.html`) and the
* combat math arena (`arena.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: resolve(__dirname, 'index.html'),
acts: resolve(__dirname, 'acts.html'),
'acts-zh': resolve(__dirname, 'acts-zh.html'),
'acts-en': resolve(__dirname, 'acts-en.html'),
arena: resolve(__dirname, 'arena.html'),
loot: resolve(__dirname, 'loot.html'),
boss: resolve(__dirname, 'boss.html'),
skills: resolve(__dirname, 'skills.html'),
},
},
},
})