Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

onieyanihh's avatar

Vite and TailwindCSS not working on my live server.

hi. I need help. I have a laravel project and i install tailwindcss with vite. why does my @vite not working on live server. and when i tried it on localhost, i need to open terminal and type "npm run dev" before the vite works.

here's my configuration.

vite.config.js

import { defineConfig } from 'vite';
import tailwindcss from "tailwindcss";
import laravel from 'laravel-vite-plugin';

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/css/app.css', 'resources/js/app.js'],
            refresh: true,
        }),
        tailwindcss(),
    ],
    build: {
        chunkSizeWarningLimit: 1600,
      },
});

in my app.blade.php i just insert

@vite(['resources/css/app.css', 'resources/js/app.js'])

for my @vite to work, i need to open a terminal in my localhost and then npm run dev. but in live server, do i need to npm run dev as well and install npm or something i need for npm to work?

0 likes
3 replies
vincent15000's avatar

Have you done this before sending the code to the live server ?

npm run build

And you need to add the build folder when you push the code.

onieyanihh's avatar

I mean, the npm run build works in localhost, but when i try to upload it on live server, it doesnt work. its still the same and no changes made.

Please or to participate in this conversation.