-
Notifications
You must be signed in to change notification settings - Fork 25
/
vite.config.mjs
42 lines (40 loc) · 1.01 KB
/
vite.config.mjs
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
35
36
37
38
39
40
41
42
import * as child from "child_process";
import { defineConfig } from "vite";
import mkcert from "vite-plugin-mkcert";
import { nodePolyfills } from "vite-plugin-node-polyfills";
import solidPlugin from "vite-plugin-solid";
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from "vite-plugin-wasm";
const commitHash = child
.execSync("git rev-parse --short HEAD")
.toString()
.trim();
export default defineConfig({
plugins: [
solidPlugin(),
wasm(),
topLevelAwait(),
mkcert(),
nodePolyfills(),
],
server: {
https: true,
cors: { origin: "*" },
},
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
},
css: {
preprocessorOptions: {
scss: {
api: "modern-compiler",
},
},
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
__GIT_COMMIT__: JSON.stringify(commitHash),
},
});