It takes a long time for gulp to start building in watch mode

Hello,

i`m using bedrock ansible to get my bedrock/sage project working.

When I start “gulp watch” after switching to the vagrant machine by using “vagrant ssl” it takes gulp a long time to start building the updated files.

The build process itself takes 6-8 seconds, which is quite long but okay. But after I save my css or js file, it takes “gulp watch” 20 seconds or more to start building the files.

I`m using the bedrock vagrant machine on a mac os x 10.7.5.

What could be the reason for gulp to take so much time to recognize that there are file changes?

Dear Regards,

Johannes

1 Like

Ok, I found the solution:

In a nutshell:
When you edit the files in your host machine and gulp is running on the virtual bedrock machine, gaze (which is used by gulp) does not get the information that the file you edited has been changed.

There are 2 solutions:

  1. Run gulp on the host machine
  2. Add
    :nfs => true,
    :mount_options => [‘actimeo=2’]
    to the vagrant nfs synced folder options.

I think solution 2 should be integrated to bedrock-ansible vagrantfile, to avoid the problem.

3 Likes

I am also experiencing a very slow build process. watch and build take between 10-25s at times… process was near 20s for my vagrant box and around 10 using MAMP. Makes for very slow dev time on minor front end work.

1 Like