{"id":700,"date":"2020-08-19T11:24:21","date_gmt":"2020-08-19T16:24:21","guid":{"rendered":"https:\/\/ma.rcbla.se\/blog\/?p=700"},"modified":"2020-08-19T11:26:50","modified_gmt":"2020-08-19T16:26:50","slug":"gulp-watch-not-firing-with-changed-files-when-run-in-wsl","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2020\/08\/gulp-watch-not-firing-with-changed-files-when-run-in-wsl\/","title":{"rendered":"gulp.watch not firing with changed files when run in WSL"},"content":{"rendered":"<p>Using WSL Debian for dev and <code>gulp.watch<\/code> is not running when files are changed on the Windows side. Solution is to add <code>{interval: 1000, usePolling: true}<\/code> to the <code>gulp.watch<\/code> event.<\/p>\n<p>For example, here&#8217;s the styles portion of my gulp.watch task.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ngulp.watch(&#x5B;path.source + 'styles\/**\/*'], {interval: 1000, usePolling: true}, gulp.series('styles'));\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using WSL Debian for dev and gulp.watch is not running when files are changed on the Windows side. Solution is to add {interval: 1000, usePolling: true} to the gulp.watch event. For example, here&#8217;s the styles portion of my gulp.watch task. gulp.watch(&#x5B;path.source + &#8216;styles\/**\/*&#8217;], {interval: 1000, usePolling: true}, gulp.series(&#8216;styles&#8217;));<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3],"tags":[],"class_list":["post-700","post","type-post","status-publish","format-standard","hentry","category-coding","category-discoveries"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=700"}],"version-history":[{"count":3,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/700\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/700\/revisions\/703"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}