Search code examples
laravelwebpacktailwind-csslaravel-mix

there is no webpack.mix.js file in my laravel project root


my laravel version is 9.22.1

I want to install tailwindcss in Laravel.

Do I have to manually install webpack and laravel-mix?


Solution

  • The laravel-mix documentation (v2.1 Installation) has an info-box with an exclamation mark pretty high up at the beginning of the document (!):

    You won't find a webpack.config.js file in your project root. By default, Laravel defers to the config file from this repo. However, should you need to configure it, you may copy the file to your project root, and then update your package.json NPM scripts accordingly: cp node_modules/laravel-mix/setup/webpack.config.js ./ .