aboutsummaryrefslogtreecommitdiff
path: root/static/vite.config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'static/vite.config.ts')
-rw-r--r--static/vite.config.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/static/vite.config.ts b/static/vite.config.ts
new file mode 100644
index 0000000..0582da4
--- /dev/null
+++ b/static/vite.config.ts
@@ -0,0 +1,27 @@
+import { fileURLToPath, URL } from "node:url";
+import { dynamicBase } from "vite-plugin-dynamic-base";
+import { defineConfig } from "vite";
+import inject from "@rollup/plugin-inject";
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [
+ dynamicBase({
+ // dynamic public path var string, default window.__dynamic_base__
+ publicPath: "",
+ // dynamic load resources on index.html, default false. maybe change default true
+ transformIndexHtml: false,
+ }),
+ inject({
+ // => that should be first under plugins array
+ $: "jquery",
+ jQuery: "jquery",
+ }),
+ ],
+ resolve: {
+ alias: {
+ "@": fileURLToPath(new URL("./src", import.meta.url)),
+ },
+ },
+ base: "/static/",
+});