1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-26 07:13:41 +01:00
Files
dozzle/vite.config.ts
Amir Raminfar ba32d125ac Tries to inline favicon to fix #1714 (#1717)
* Tries to inline favicon to fix #1714

* Updates go tests
2022-04-16 14:55:34 -07:00

50 lines
1.0 KiB
TypeScript

import path from "path";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import Icons from "unplugin-icons/vite";
import Components from "unplugin-vue-components/vite";
import IconsResolver from "unplugin-icons/resolver";
export default defineConfig(({ mode }) => ({
resolve: {
alias: {
"@/": `${path.resolve(__dirname, "assets")}/`,
},
},
base: mode === "production" ? "/{{ .Base }}/" : "/",
plugins: [
vue(),
Icons({
autoInstall: true,
}),
Components({
dirs: ["assets/components"],
resolvers: [
IconsResolver({
componentPrefix: "",
}),
],
dts: "assets/components.d.ts",
}),
htmlPlugin(mode),
],
server: {
proxy: {
"/api": {
target: "http://localhost:3100/",
},
},
},
}));
const htmlPlugin = (mode) => {
return {
name: "html-transform",
enforce: "post",
transformIndexHtml(html) {
return mode === "production" ? html.replaceAll("/{{ .Base }}/", "{{ .Base }}/") : html;
},
};
};