Self-hostable website analytics on Django: a straightforward collector API, dashboards, a world map, and PDF reports.
analyticsdjangodockerhandcodedpythonself-hostedsqliteviteweb-analytics
1import { resolve } from "path";
2import { defineConfig } from "vite";
3
4export default defineConfig({
5 base: "/static/",
6 build: {
7 outDir: resolve(__dirname, "analytics/static"),
8 emptyOutDir: true,
9 rollupOptions: {
10 input: {
11 base: resolve(__dirname, "analytics/static_src/index.js"),
12 pages: resolve(__dirname, "pages/static_src/index.js"),
13 properties: resolve(__dirname, "properties/static_src/index.js"),
14 collector: resolve(__dirname, "collector/static_src/index.js"),
15 },
16 output: {
17 entryFileNames: "[name].js",
18 assetFileNames: (assetInfo) => {
19 if (/\.(png|jpg|gif|svg|webp)$/.test(assetInfo.name)) {
20 return "images/[name][extname]";
21 }
22 return "[name][extname]";
23 },
24 },
25 },
26 },
27 css: {
28 preprocessorOptions: {
29 scss: {
30 quietDeps: true,
31 },
32 },
33 },
34});