ploi / roadmap

Open source roadmapping software
https://roadmap.ploi.io
MIT License
418 stars 84 forks source link

Livewire docs recommend adding to post-autoload-dump #274

Closed hackerESQ closed 3 months ago

hackerESQ commented 3 months ago

Per the Livewire docs, this is recommended.

Publishing Frontend Assets

If you prefer the JavaScript assets to be served by your web server not through Laravel, use the livewire:publish command:

php artisan livewire:publish --assets

To keep the assets up-to-date and avoid issues in future updates, we highly recommend adding the command to the post-autoload-dump scripts in your composer.json file:

{
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi",
            "@php artisan vendor:publish --force --tag=livewire:assets --ansi"
        ]
    }
}

See: https://laravel-livewire.com/docs/2.x/installation#publish-assets

Cannonb4ll commented 3 months ago

Thank you for this PR. Sadly, the docs you're sending are V2 and we're using V3.

Also, this is not recommended as stated in the docs:

Publishing Livewire's assets isn't necessary for Livewire to run. Only do this if you have a specific need for it.

https://livewire.laravel.com/docs/installation#publishing-livewires-frontend-assets

The V2 also does not suggest it by the way, their talking about 'prefer' rather than 'required'.

If you prefer the JavaScript assets to be served by your web server not through Laravel, use the livewire:publish command

Stil, thank you! 💙