loewydesign / loewy-assets

A front-end asset pipeline driven by gulp.js.
MIT License
12 stars 3 forks source link

SCSS and CSS watches conflict #4

Closed agopshi closed 8 years ago

agopshi commented 8 years ago

Looks like there are conflicts between the SCSS and CSS watches when multiple CSS files are generated by the SCSS compilation. The CSS watch ends up executing the css task multiple times (once per output CSS file), and that causes read/write issues.

To fix this, we should simplify the sass.js and css.js tasks into a single styles.js task which does the following:

  1. Watch for updates to SCSS files. (Currently in sass.js.)
  2. Compile the SCSS into CSS. (Currently in sass.js.)
  3. Move the CSS files into the development CSS directory. (Currently in sass.js.)
  4. Run autoprefixer. (Currently in css.js.)
  5. Move the final CSS files into the release CSS directory. (Currently in css.js.)
dan-hhog commented 8 years ago

@agopshi just need permission to update the npm package so I can commit the package.json version update in the develop branch and then merge with master.

dan-hhog commented 8 years ago

@agopshi Thanks for the info. Scss and css tasks are now a single styles task. Update is in dev & master.

agopshi commented 8 years ago

@dan-ld Did you try this using a single stream instead of merging two streams?

dan-hhog commented 8 years ago

@agop-ld I originally merged two streams but then updated it so that it currently is using a single stream.

Dan Morales Solutions Developer Office: (631) 249-2429 ext. 121 Hedgehog Development, LLC.http://www.hhogdev.com/ Productshttp://www.hhogdev.com/products.aspx | Serviceshttp://www.hhogdev.com/solutions.aspx | Twitterhttps://twitter.com/hhogdev | Facebookhttps://www.facebook.com/hhogdev | Linkedinhttps://www.linkedin.com/company/hedgehog-development | Jobshttp://www.hhogdev.com/careers/jobopenings.aspx

From: Agop Shirinian [mailto:notifications@github.com] Sent: Friday, June 03, 2016 11:30 AM To: loewydesign/loewy-assets loewy-assets@noreply.github.com Cc: dan-ld dan@loewy.com; Mention mention@noreply.github.com Subject: Re: [loewydesign/loewy-assets] SCSS and CSS watches conflict (#4)

@dan-ldhttps://github.com/dan-ld Did you try this using a single stream instead of merging two streams?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/loewydesign/loewy-assets/issues/4#issuecomment-223611384, or mute the threadhttps://github.com/notifications/unsubscribe/AKlW5mpnUZCqBGwAHQKGc6kOZ-9CMsNoks5qIEiSgaJpZM4IhkFQ.

agopshi commented 8 years ago

@dan-ld Sweet, this is looking good. One last thing - make sure to return that gulp stream. Right now, it's just being assigned to a variable. Without returning the gulp stream (or calling the done callback), gulp has no way of knowing when the task finishes.

dan-hhog commented 8 years ago

@agopshi Thanks! I've updated the task to return the gulp stream instead of calling the done callback.