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

brtbrt's avatar

Is it normal that tailwind.config.js, vite.config.js are in root folder of Laravel 9?

Fresh install of Vite and Tailwind results in tailwind.config.js, postcss.config.js and vite.config.js in the root folder of Laravel 9.

Is this expected? I want to organize these file into the existing resources/js folder. Where do I update references to these files to avoid breaking things?

0 likes
6 replies
thinkverse's avatar

Yes, that's normal, they are configuration files and should live in the root. 👍

brtbrt's avatar

There is a /config/ folder for that, no?

thinkverse's avatar
Level 15

That's for Laravel's configuration. vite.config.js is the main configuration for Vite, the assets bundler Laravel uses. postcss.config.js is used by PostCSS to configure plugins, such as Tailwind CSS. tailwind.config.js is used to configure your Tailwind CSS, like custom colors, font families, plugins, themes, and more.

Laravel doesn't handle asset bundling itself - and when I say assets I'm talking JavaScript and CSS, so it uses Vite instead for that. And Vite looks in the root of the project folder for the config file by default, as does PostCSS and Tailwind CSS.

By default, Tailwind will look for an optional tailwind.config.js file at the root of your project where you can define any customizations.

brtbrt's avatar

I do understand that, but I find it extremely messy for these configuration files to live in the root. But I guess I'll have to live with it :)

Please or to participate in this conversation.