• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
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
7
192
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 9 days ago

    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 6 days ago Reply Quote 0
    • Rishabh-Webkul
      Rishabh-Webkul last edited by 8 days ago

      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 7 days ago Reply Quote 0
      • A
        arunchahar @arunchahar last edited by 7 days ago

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

          @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 6 days ago

            @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 6 days ago

              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)

              A 1 Reply Last reply about 4 hours ago Reply Quote 0
              • A
                arunchahar @eldomagan_ last edited by arunchahar about 4 hours ago about 4 hours ago

                @eldomagan_ Thank you so much! You truly saved my day.
                This issue had really been driving me crazy, and I genuinely appreciate your help and support.
                Cheers!

                1 Reply Last reply Reply Quote 0
                2 out of 7
                • First post
                  2/7
                  Last post