66 lines
1.7 KiB
TypeScript
66 lines
1.7 KiB
TypeScript
import { fileURLToPath, URL } from "node:url";
|
|
|
|
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import vueDevTools from "vite-plugin-vue-devtools";
|
|
import { VitePWA } from "vite-plugin-pwa";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue({
|
|
include: [/\.vue$/, /\.md$/],
|
|
template: {
|
|
compilerOptions: {
|
|
isCustomElement: (tag) => ["lottie-player"].includes(tag),
|
|
},
|
|
},
|
|
}),
|
|
vueDevTools(),
|
|
VitePWA({
|
|
registerType: "autoUpdate",
|
|
injectRegister: "auto",
|
|
includeAssets: ["favicon.png", "favicon.ico"],
|
|
manifest: {
|
|
name: "__APPNAMEOVERWRITE__",
|
|
short_name: "__APPNAMEOVERWRITE__",
|
|
theme_color: "#990b00",
|
|
display: "standalone",
|
|
start_url: "/",
|
|
icons: [
|
|
{
|
|
src: "favicon.ico",
|
|
sizes: "48x48",
|
|
type: "image/ico",
|
|
},
|
|
{
|
|
src: "favicon.png",
|
|
sizes: "512x512",
|
|
type: "image/png",
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
// Define the main output bundle (e.g., for your application)
|
|
entryFileNames: "[name]-[hash].js",
|
|
// Define the directory where the main bundle should be output
|
|
dir: "dist",
|
|
// Create a separate output bundle for your specific file
|
|
manualChunks(id) {
|
|
if (id.endsWith("src/config.ts")) {
|
|
return "config"; // This will create a separate bundle for config-[hash].js
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|