1
0
mirror of https://github.com/teoxoy/factorio-blueprint-editor.git synced 2025-03-19 21:08:03 +02:00
2024-11-17 20:07:42 +01:00

34 lines
827 B
TypeScript

import { defineConfig, Plugin } from 'vite'
import { viteStaticCopy } from 'vite-plugin-static-copy'
const fullReloadAlways: Plugin = {
name: 'full-reload',
handleHotUpdate({ server }) {
server.ws.send({ type: 'full-reload' })
return []
},
}
export default defineConfig(({ command }) => ({
build: { sourcemap: true },
preview: { port: 8080 },
server: {
port: 8080,
proxy: {
'/data': 'http://localhost:8888',
},
},
plugins: [
command === 'build'
? viteStaticCopy({
targets: [
{
src: '../exporter/data/output',
dest: 'data',
},
],
})
: fullReloadAlways,
],
}))