fgeierst / typo3-vite-demo

GNU General Public License v2.0
20 stars 5 forks source link

Watch .html with Vite and reload browser #3

Closed fgeierst closed 1 year ago

fgeierst commented 2 years ago

The Rollup watcher does not help here, because we want the browser to reload if the html templates change in Vite dev mode.

Maybe look at

felixranesberger commented 1 year ago

Interesting idea!

But isn't an automatic page reload every time a change is made a bit inefficient due to the somewhat more time-consuming fluid compilation?

I wonder if you could split the HTML files into logical chunks that are only recompiled when something has changed in the file. With Turbo, the individual parts could then be replaced on the fly on the web page.

But for this I lack the knowledge of how Fluid compiles files.

fgeierst commented 1 year ago

Watching template files is now working thanks to https://github.com/ElMassimo/vite-plugin-full-reload.

@felixranesberger Nice idea - let's see what the upcoming Topwire extension brings.

fgeierst commented 1 year ago

Here is a PR #20 by @misterboe that replaces vite-plugin-full-reload with a custom Vite plugin to watch html, typoscript, yaml and php files.

misterboe commented 1 year ago

Solved by #20

fgeierst commented 1 year ago

vite-plugin-full-reload works, too, but I preferred the solution by @misterboe because it removes a NPM dependency and two child dependencies from the setup. Thanks!