cearls / timberland

A modern WordPress theme using Timber, Advanced Custom Fields Pro, Vite, Tailwind and Alpine.js
MIT License
82 stars 21 forks source link

vite.config.js documentation #39

Closed bdfpplinsinga closed 6 months ago

bdfpplinsinga commented 6 months ago

Hi Chris,

Quick question. Im using your new setup with vite and it looks really good. I have only a small thing. I cant seem to get the vite config right. What do i need to change to get this live reload working?

I tried to change the host but no luck with that. Im i missing something?

bdfpplinsinga commented 6 months ago

Nevermind. Just had to add :

liveReload: true,
cearls commented 6 months ago

Hey! Live reload should be working by default in development. It's controlled by the vite environment setting in the config.json file.

https://github.com/cearls/timberland/blob/main/config.json

Live reload will be disabled if the config.json file doesn't exist, which is how I run the theme on a production site (only theme and vendor directories), or if the vite environment setting is set to production.

bdfpplinsinga commented 6 months ago

Hee Chris,

In my setup this doesn't seem to work. Maybe this has anything to do with the fact that I'm using 'normal' urls instead of localhost. So by default it's opening localhost:3000 when running npm run dev. But this gives back a dns error.