zap.stream/vite.config.ts

54 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-12-04 11:01:56 +00:00
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
import { defineConfig } from "vite";
2023-12-05 12:58:17 +00:00
import { visualizer } from "rollup-plugin-visualizer";
2023-12-04 11:01:56 +00:00
import { vitePluginVersionMark } from "vite-plugin-version-mark";
export default defineConfig({
plugins: [
react({
babel: {
configFile: true,
},
}),
2023-12-04 11:01:56 +00:00
VitePWA({
strategies: "injectManifest",
srcDir: "src",
filename: "service-worker.ts",
2024-03-04 12:44:17 +00:00
registerType: "autoUpdate",
2023-12-04 11:01:56 +00:00
devOptions: {
2023-12-04 12:18:16 +00:00
enabled: false,
2023-12-04 11:01:56 +00:00
type: "module",
},
}),
vitePluginVersionMark({
name: "zap.stream",
ifGitSHA: true,
command: "git describe --always --tags",
2023-12-04 12:56:20 +00:00
ifMeta: false,
2023-12-04 11:01:56 +00:00
}),
2023-12-05 12:58:17 +00:00
visualizer({
open: true,
gzipSize: true,
filename: "build/stats.html",
}),
2023-12-04 11:01:56 +00:00
],
2024-01-30 23:18:29 +00:00
assetsInclude: ["**/*.md", "**/*.wasm"],
2023-12-04 11:01:56 +00:00
build: {
outDir: "build",
2024-03-04 16:59:26 +00:00
sourcemap: true,
2024-03-04 12:44:17 +00:00
},
worker: {
format: "es",
2023-12-04 11:01:56 +00:00
},
clearScreen: false,
resolve: {
alias: {
"@": "/src",
},
},
define: {
global: {},
},
});