-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
27 lines (24 loc) · 935 Bytes
/
vite.config.ts
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
import react from "@vitejs/plugin-react";
import fs from "node:fs";
import { defineConfig } from "vite";
// https://vitejs.dev/config/
export default defineConfig({
define: {
// https://vitejs.dev/config/#environment-variables
// https://stackoverflow.com/questions/67194082/how-can-i-display-the-current-app-version-from-package-json-to-the-user-using-vi
__APP_ENV_NAME__: JSON.stringify(process.env.npm_package_name),
__APP_ENV_VERSION__: JSON.stringify(process.env.npm_package_version),
},
plugins: [react()],
server: {
// Como o uso da camera depende um ambiente seguro,
// para desenvolvimento é necessário gerar certificados
// locais e configurar o vite para usá-los.
// https://vitejs.dev/config/server-options.html#server-https
https: {
key: fs.readFileSync("local-cert/key.pem"),
cert: fs.readFileSync("local-cert/cert.pem"),
},
host: "0.0.0.0",
},
});