kennel/static/vite.config.ts

28 lines
745 B
TypeScript
Raw Permalink Normal View History

2024-08-24 16:03:50 -04:00
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/",
});