2023-11-20 19:16:47 +00:00
|
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
|
|
import { visualizer } from "rollup-plugin-visualizer";
|
|
|
|
import { defineConfig } from "vite";
|
2023-11-20 21:51:23 +00:00
|
|
|
import { vitePluginVersionMark } from "vite-plugin-version-mark";
|
2023-11-17 11:52:10 +00:00
|
|
|
|
|
|
|
import appConfig from "config";
|
|
|
|
|
|
|
|
export default defineConfig({
|
2023-11-20 12:22:52 +00:00
|
|
|
plugins: [
|
|
|
|
react(),
|
|
|
|
VitePWA({
|
2023-11-20 19:16:47 +00:00
|
|
|
strategies: "injectManifest",
|
|
|
|
srcDir: "src",
|
|
|
|
filename: "service-worker.ts",
|
2023-11-20 12:22:52 +00:00
|
|
|
devOptions: {
|
|
|
|
enabled: true,
|
2023-11-20 19:16:47 +00:00
|
|
|
type: "module",
|
|
|
|
},
|
2023-11-20 14:19:15 +00:00
|
|
|
}),
|
|
|
|
visualizer({
|
|
|
|
open: true,
|
|
|
|
gzipSize: true,
|
2023-11-20 19:16:47 +00:00
|
|
|
filename: "dist/stats.html",
|
|
|
|
}),
|
2023-11-20 21:51:23 +00:00
|
|
|
vitePluginVersionMark({
|
|
|
|
name: "snort",
|
|
|
|
ifGitSHA: true,
|
|
|
|
command: "git describe --always --tags",
|
|
|
|
}),
|
2023-11-20 12:22:52 +00:00
|
|
|
],
|
2023-11-20 19:37:56 +00:00
|
|
|
assetsInclude: ["**/*.md", "**/*.wasm"],
|
2023-11-20 19:36:22 +00:00
|
|
|
build: {
|
2023-11-20 19:37:56 +00:00
|
|
|
outDir: "build",
|
2023-11-20 19:36:22 +00:00
|
|
|
},
|
2023-11-17 11:52:10 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2023-11-20 19:16:47 +00:00
|
|
|
"@": "/src",
|
2023-11-17 11:52:10 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
define: {
|
|
|
|
CONFIG: JSON.stringify(appConfig),
|
|
|
|
global: {}, // needed for custom-event lib
|
|
|
|
SINGLE_RELAY: JSON.stringify(process.env.SINGLE_RELAY),
|
|
|
|
},
|
|
|
|
});
|