@brandy
In Vue.js 3, you can force Vite to clear the cache by adding a query parameter to the request when you import a module. Here's how you can do it:
1
|
import { myModule } from './myModule.js?v=' + Date.now(); |
By adding a query parameter with a changing value to the import statement, Vite will treat it as a new dependency and fetch the module again, bypassing the cache.
Note: This should only be used during development, as it may impact the performance in a production environment.