gravitydepartment / frontend-starter

A simple HTML + CSS + JS baseline with Gulp build tools.
5 stars 1 forks source link

Update to Gulp 4 #1

Closed brendanfalkowski closed 5 years ago

brendanfalkowski commented 5 years ago

Gulp 4 docs: https://gulpjs.com/docs/en/getting-started/quick-start

brendanfalkowski commented 5 years ago

The last hurdle to getting this working is resolving this issue, which causes the watch to stop recognizing changes in a JS file after an error is encountered: https://github.com/gulpjs/gulp/issues/359

Steps to reproduce

  1. Clone this repo
  2. Switch to branch issue/1-update-to-gulp-4
  3. Run npm install
  4. Run gulp watch
  5. Open the file js/src/module/thing.js
  6. Type some valid JS and save — note: the watcher reacts to each save
  7. Type invalid JS and save — note: the watcher reacts to saving once, then never again

Note — in gulpfile.js only the function jsThing() doesn't use createJsModule() which was meant to improve readability when dozens of modules exist in the build (all JS bundling tasks are the same). Retaining this is far less important making the watcher work after finding errors.

I think the issue lies in the return types, so I was trying to isolate the code for just one of the bundle creators when testing changes. I just couldn't find the right mix to keep the watcher working for JS (it does work for CSS).

brendanfalkowski commented 5 years ago

Merged fixes in from: https://github.com/gravitydepartment/frontend-starter/pull/2