~starkingdoms/starkingdoms

ref: 02df8a053b6bfd7d2ee9fbdbd60fe29137b63a7c starkingdoms/starkingdoms-client/vite.config.ts -rw-r--r-- 683 bytes
02df8a05 — core Merge branch 'bevy_rewrite' of gitlab.com:starkingdoms.tk/starkingdoms.tk into bevy_rewrite 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {defineConfig, PluginOption} from "vite";
import * as child from "child_process";

const commitHash = child.execSync('git describe --no-match --always --abbrev=8 --dirty').toString().trim();

const fullReloadAlways: PluginOption = {
    handleHotUpdate({ server }) {
        server.ws.send({ type: "full-reload" })
        return []
    },
} as PluginOption

export default defineConfig({
    plugins: [fullReloadAlways],
    define: {
        APP_VERSION: JSON.stringify(process.env.npm_package_version),
        COMMIT_HASH: JSON.stringify(commitHash)
    },
    build: {
        target: ['chrome89', 'edge89', 'firefox89', 'safari15'],
        cssCodeSplit: false,
    }
})