0

I building a boilerplate(Craft CMS) thats uses the power of Vite js, I got this project up and running using DDEV and it runs without problems on Windows 10.

However when I spin up the same project on my Macbook Pro Im getting extremely slow HMR reload times. JS, (s)css and Twig changes take over 30-70 sec to be noticed (time it takes to see the console notice and the browser to automatically refresh).

When HMR is not running and I make changes to the Twig template and I refresh the browser myself I do see the changed instantly. So I guess this had something to do with my Docker settings?

Some info:

  • Macbook Pro 2017 - Version 10.15.7
    • 2,3GHz dual core i5
    • 16GB ram
  • Docker Version 4.0.0(67817), engine 20.10.8
  • Running the latest version of Vite js inside the DDEV container(SSH)
    • enter image description here
  • You don't say whether you were running WSL2 on Win10 (which is massively faster than Docker for Mac). I assume if you had adequate performance on Windows that would be the case. Could you please try the new Mutagen feature in ddev v1.18 (still in rc, but will be full release soon). Releases and instructions at https://github.com/drud/ddev/releases, docs at https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen – rfay Sep 13 '21 at 12:57
  • You also may be happy with enabling NFS, not nearly as fast as mutagen, but most people use it on mac. https://ddev.readthedocs.io/en/latest/users/performance/#using-nfs-to-mount-the-project-into-the-web-container – rfay Sep 13 '21 at 12:58
  • Oh, just read more closely. I assume HMR is dependent on fsnotify/inotify, and maybe you're already using NFS, which doesn't have inotify. Mutagen will make you happy on that score. Tools that rely on inotify have to poll when it's not available, getting the behavior you're talking about. (But please say what HMR is :) ) – rfay Sep 13 '21 at 13:00
  • 1
    @rfay, using mutagen changed the response time significant! Going to explore some more tonight when i have more time. But on first look, this seems to be fixed! CSS changes are instantly, js and twig changes take max 2-5sec (mostly faster). – Arno Ramon Sep 13 '21 at 13:18

0 Answers0