wn-discoteam-theme/vite.config.js

39 lines
952 B
JavaScript

const Dotenv = require("dotenv");
import liveReload from "vite-plugin-live-reload";
import VitePluginSvgSpritemap from "@spiriit/vite-plugin-svg-spritemap";
Dotenv.config();
const ASSET_URL = process.env.ASSET_URL || "http://localhost:3000";
const VITE_INPUT = process.env.VITE_INPUT || "resources/js/app.js";
export default ({ command }) => {
return {
base:
command === "serve"
? "/themes/vite-tailwind/"
: "/themes/vite-tailwind/assets/public/",
/*base: `${ASSET_URL}`,*/
publicDir: "resources/public",
build: {
manifest: "manifest.json",
outDir: "assets/public",
assetsDir: "",
rollupOptions: {
input: `${VITE_INPUT}`,
},
},
server: {
strictPort: true,
port: 3000,
},
resolve: {
extensions: [".js", ".mjs"],
},
plugins: [
liveReload("./**/*.htm"),
VitePluginSvgSpritemap("./resources/icons/*.svg"),
],
};
};