[0.3.x] Support full page reload on blade / arbitrary file changes #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces the ability to preform full page refreshes when specific files change. This is extremely useful when changes are made to Blade files, routes, and other files that will impact the application.
This feature is built atop of the fantastic plugin that was created in the Ruby community: https://github.com/ElMassimo/vite-plugin-full-reload. This Plugin can of course be used directly, however we are introducing some nice defaults and an escape hatch via the Laravel plugin.
refresh: true
This option sets some sensible defaults for the plugin. It will listen for changes on...
Example config...
refresh: string
This option allows you to specify a single path to watch.
Example config...
refresh: string[]
This option allows you to specify a list of paths to watch.
Example config...
refresh: FullRefreshConfig
This option allows you to specify a full config that is passed to the underlying plugin. See their config references for more details...
Example config...
refresh: FullRefreshConfig[]
This option allows you to specify an array of full configurations that are passed to the underlying plugin and create multiple instances. This is the same as specifying the plugin multiple times which you may want if you want a delay on refreshing some paths and not others because there is a 3rd party build process for certain paths...
Example config...
Questions to answer before merging
config/**
) in the "default" option?.env
changes?Notes
0.3.0
release, as the return value of thelaravel()
function in thevite.config.js
file is now an array, which is the documented way of returning multiple plugins from a single plugin. This also opens the door to us bringing in more helpers with good defaults under the hood in the future.