wn-discoteam-theme/vite.config.js

38 lines
919 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-02-13 01:49:21 +01:00
: "/themes/vite-tailwind/build/",
2024-02-13 01:41:48 +01:00
/*base: `${ASSET_URL}`,*/
publicDir: "fake_dir_so_nothing_gets_copied",
build: {
manifest: true,
outDir: "build",
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
};