laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 31 forks source link

add a --tailwind flag to artisan:serve #2643

Closed tobz-nz closed 3 years ago

tobz-nz commented 3 years ago

How about adding a --tailwind flag to artisan:serve that runs npx tailwindcss -o public/app.css --watch --jit --purge="./resources/**/*.blade.php" when starting the server.

ahinkle commented 3 years ago

Shouldn't really be needed with Laravel Mix and making some small adjustments to your package.json file within your application:

currently:

"scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },

Update your development script with Tailwind:

    "development": "TAILWIND_MODE=build mix",

Given that you have JIT and purge setup within your Tailwind configuration.

tobz-nz commented 3 years ago

Lol, of course. I don't know where my head was at when I posted this.