28 lines
745 B
TypeScript
28 lines
745 B
TypeScript
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/",
|
|
});
|