| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { defineConfig, loadEnv } from "vite";
- import vue from "@vitejs/plugin-vue";
- import laravel from "laravel-vite-plugin";
- import path from "path";
- export default defineConfig(({ mode }) => {
- const envDir = "../../../";
- Object.assign(process.env, loadEnv(mode, envDir));
- return {
- build: {
- emptyOutDir: true,
- minify: "esbuild",
- cssCodeSplit: true,
- rollupOptions: {
- output: {
- manualChunks: {
- vue: ["vue"],
- veeValidate: ["vee-validate", "@vee-validate/rules", "@vee-validate/i18n"],
- vendor: ["axios", "mitt"]
- }
- }
- }
- },
- envDir,
- server: {
- host: process.env.VITE_HOST || "localhost",
- port: process.env.VITE_PORT || 5173,
- cors: true,
- },
- plugins: [
- vue(),
- laravel({
- hotFile: "../../../public/shop-default-vite.hot",
- publicDirectory: "../../../public",
- buildDirectory: "themes/shop/default/build",
- input: [
- "src/Resources/assets/css/app.css",
- "src/Resources/assets/js/app.js",
- ],
- refresh: true,
- preload: false,
- }),
- ],
- experimental: {
- renderBuiltUrl(filename, { hostId, hostType, type }) {
- if (hostType === "css") {
- return path.basename(filename);
- }
- },
- },
- };
- });
|