2024-07-14 12:28:44 +00:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import solid from "vite-plugin-solid";
|
|
|
|
import solidStyled from "vite-plugin-solid-styled";
|
|
|
|
import suid from "@suid/vite-plugin";
|
|
|
|
import { VitePWA } from "vite-plugin-pwa";
|
2024-07-22 13:57:04 +00:00
|
|
|
import version from "vite-plugin-package-version";
|
2024-07-14 12:28:44 +00:00
|
|
|
|
|
|
|
export default defineConfig(({ mode }) => ({
|
|
|
|
plugins: [
|
|
|
|
suid(),
|
|
|
|
solid(),
|
|
|
|
solidStyled({
|
|
|
|
filter: {
|
|
|
|
include: "src/**/*.{tsx,jsx}",
|
|
|
|
exclude: "node_modules/**/*.{ts,js,tsx,jsx}",
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
VitePWA({
|
|
|
|
registerType: "autoUpdate",
|
2024-07-23 06:16:35 +00:00
|
|
|
devOptions: {
|
|
|
|
enabled: mode === "staging",
|
|
|
|
},
|
2024-07-14 12:28:44 +00:00
|
|
|
}),
|
2024-07-22 13:57:04 +00:00
|
|
|
version(),
|
2024-07-14 12:28:44 +00:00
|
|
|
],
|
2024-07-23 06:16:35 +00:00
|
|
|
server: {
|
|
|
|
https: {
|
|
|
|
// localhost.direct: https://github.com/Upinel/localhost.direct
|
|
|
|
key: "tools/certs/localhost.direct.key",
|
|
|
|
cert: "tools/certs/localhost.direct.crt",
|
|
|
|
passphrase: "localhost",
|
|
|
|
},
|
|
|
|
},
|
2024-07-22 13:57:04 +00:00
|
|
|
define: {
|
|
|
|
"import.meta.env.BUILT_AT": `"${new Date().toISOString()}"`,
|
|
|
|
},
|
2024-07-14 12:28:44 +00:00
|
|
|
css: {
|
|
|
|
devSourcemap: true,
|
|
|
|
},
|
|
|
|
build: {
|
|
|
|
target: ["firefox98", "safari15.4", "ios15.4", "chrome84", "edge87"],
|
2024-07-14 13:26:55 +00:00
|
|
|
sourcemap: true,
|
2024-07-14 12:28:44 +00:00
|
|
|
},
|
|
|
|
}));
|