From 5dc264e08253c3a97ea41d1fde5fbf3f33dd6591 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 24 Aug 2024 13:03:50 -0700 Subject: bring in jQuery, build with Vite --- static/vite.config.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 static/vite.config.ts (limited to 'static/vite.config.ts') 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/", +}); -- cgit v1.3