~starkingdoms/starkingdoms

ref: ccb7ac1036a620f213bb5d24a3332091074e3667 starkingdoms/starkingdoms-client/vite.config.ts -rw-r--r-- 803 bytes
ccb7ac10 — ghostlyzsh Merge branch 'bevy_rewrite' of https://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
24
25
26
27
28
29
30
31
32
33
34
import { defineConfig } from "vite";
import { resolve } from "path";
import * as child from "child_process";
//@ts-ignore
import autoprefixer from "autoprefixer";

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

export default defineConfig({
  plugins: [],
  define: {
    APP_VERSION: JSON.stringify(process.env.npm_package_version),
    COMMIT_HASH: JSON.stringify(commitHash),
  },
  build: {
    target: ["chrome89", "edge89", "firefox89", "safari15"],
    cssCodeSplit: false,
    rollupOptions: {
      input: {
        main: resolve(__dirname, "index.html"),
        play: resolve(__dirname, "play/index.html"),
      },
    },
  },
  appType: "mpa",
  css: {
    postcss: {
      plugins: [autoprefixer({})],
    },
  },
});