laravelvitelaravel-vite

Laravel Vite Can't change base url for ping pong


I am using my own nginx server to run laravel application. The problem that I cannot change base_url/__vite_ping. It tries to request https://server.test/__vite_ping rather than https://localhost:3000/__vite_ping. Here is my vite.config.js

import {defineConfig} from 'vite';
import fs from 'fs';
import laravel from 'laravel-vite-plugin';

const ASSET_URL = process.env.ASSET_URL || '';

export default defineConfig({
    base: `${ASSET_URL}`,
    server: {
        https: {
            key: fs.readFileSync('resources/ssl/localhost.key'),
            cert: fs.readFileSync('resources/ssl/localhost.crt'),
        },
        host: 'localhost',
    },
    plugins: [
        laravel({
            input: [
                'resources/css/app.css',
                'resources/js/app.js',
            ],
            refresh: true,
        }),
    ],
});

When I run vite -d, the config base does not change its always remains with value '/', is there a way to change base_url ?


Solution

  • The issue is closed, as somehow it got resolved by itself, I had problem with one of my memory so it could have caused some bugs I could not explain.