Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Vite Not Reflecting File Changes Without Cache Clear in Bagisto – How to Fix in Dev?

    General Discussion
    3
    6
    86
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      arunchahar last edited by

      Hi Team,

      I'm working on a custom Bagisto theme using Vite for asset bundling. The setup works fine, but I'm facing an issue during development:

      Every time I make a change to my CSS/JS or Blade files, I have to manually clear the cache to see the updates.

      Here’s a summary of my setup:

      Using laravel-vite-plugin in Bagisto (inside a custom theme)
      .env is set to:

      APP_ENV=local
      APP_DEBUG=true
      
      

      I’m running npm run dev during development

      Can anyone guide me how to fix this properly for development so changes reflect instantly without clearing cache every time?
      Any tips or best practices would be greatly appreciated.

      Thanks in advance! 🙏

      A E 2 Replies Last reply Reply Quote 0
      • Rishabh-Webkul
        Rishabh-Webkul last edited by

        Hello @arunchahar

        Whenever any changes are made, it's important to recompile the assets.
        To do this, you need to run either npm run build or npm run dev.

        Warm Regards
        Team Bagisto

        A 1 Reply Last reply Reply Quote 0
        • A
          arunchahar @arunchahar last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • A
            arunchahar @Rishabh-Webkul last edited by

            @Rishabh-Webkul I am already using npm run dev and also tried npm run build, but new changes don't show until I run php artisan cache:clear. Do I need to clear the cache every time? Is there any way to avoid this during development?

            1 Reply Last reply Reply Quote 0
            • Rishabh-Webkul
              Rishabh-Webkul last edited by

              @arunchahar said in Vite Not Reflecting File Changes Without Cache Clear in Bagisto – How to Fix in Dev?:

              I am already using npm run dev and also tried npm run build, but new changes don't show until I run php artisan cache:clear. Do I need to clear the cache every time? Is there any way to avoid this during development?

              After Making any changes in the file you need to clear the Cache.

              Regards

              1 Reply Last reply Reply Quote 0
              • E
                eldomagan_ @arunchahar last edited by

                Hi @arunchahar,

                It looks like you're encountering a response cache issue. To solve this during development, try disabling response cache in your .env file:

                RESPONSE_CACHE_ENABLED=false
                

                You should be able to see your changes reflected instantly without needing to clear the cache each time.

                Bagisto Visual - A visual editor for bagisto (https://youtu.be/49Pqrb6iVCo)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post