wn-discoteam-theme/vite.config.js

39 lines
952 B
JavaScript
Raw Normal View History

2024-02-13 01:41:48 +01:00
const Dotenv = require("dotenv");
import liveReload from "vite-plugin-live-reload";
2024-09-26 13:46:55 +02:00
import VitePluginSvgSpritemap from "@spiriit/vite-plugin-svg-spritemap";
2024-02-12 21:44:41 +01:00
Dotenv.config();
2024-02-13 01:41:48 +01:00
const ASSET_URL = process.env.ASSET_URL || "http://localhost:3000";
const VITE_INPUT = process.env.VITE_INPUT || "resources/js/app.js";
2024-02-12 21:44:41 +01:00
2024-02-13 01:41:48 +01:00
export default ({ command }) => {
return {
2024-02-13 01:49:21 +01:00
base:
command === "serve"
2024-03-05 10:08:03 +01:00
? "/themes/vite-tailwind/"
2024-10-03 12:57:11 +02:00
: "/themes/vite-tailwind/assets/public/",
2024-02-13 01:41:48 +01:00
/*base: `${ASSET_URL}`,*/
2024-10-03 12:57:11 +02:00
publicDir: "resources/public",
2024-02-13 01:41:48 +01:00
build: {
2024-10-03 12:57:11 +02:00
manifest: "manifest.json",
outDir: "assets/public",
assetsDir: "",
2024-02-13 01:41:48 +01:00
rollupOptions: {
input: `${VITE_INPUT}`,
},
},
server: {
strictPort: true,
port: 3000,
},
resolve: {
extensions: [".js", ".mjs"],
},
2024-09-26 13:46:55 +02:00
plugins: [
liveReload("./**/*.htm"),
VitePluginSvgSpritemap("./resources/icons/*.svg"),
],
2024-02-13 01:41:48 +01:00
};
2024-02-12 21:44:41 +01:00
};