Skip to content
This repository was archived by the owner on Dec 10, 2019. It is now read-only.

Commit 7435b3c

Browse files
Merge pull request #75 from pattern-lab/dev
Edition Node Gulp - 1.3.1
2 parents 8ca37dc + 77be1e6 commit 7435b3c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

gulpfile.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,13 @@ function reload() {
140140
browserSync.reload();
141141
}
142142

143+
function reloadCSS() {
144+
browserSync.reload('*.css');
145+
}
146+
143147
function watch() {
144-
gulp.watch(path.resolve(paths().source.css, '**/*.css')).on('change', gulp.series('pl-copy:css', reload));
145-
gulp.watch(path.resolve(paths().source.styleguide, '**/*.*')).on('change', gulp.series('pl-copy:styleguide', 'pl-copy:styleguide-css', reload));
148+
gulp.watch(path.resolve(paths().source.css, '**/*.css'), { awaitWriteFinish: true }).on('change', gulp.series('pl-copy:css', reloadCSS));
149+
gulp.watch(path.resolve(paths().source.styleguide, '**/*.*'), { awaitWriteFinish: true }).on('change', gulp.series('pl-copy:styleguide', 'pl-copy:styleguide-css', reloadCSS));
146150

147151
var patternWatches = [
148152
path.resolve(paths().source.patterns, '**/*.json'),
@@ -154,7 +158,7 @@ function watch() {
154158
path.resolve(paths().source.annotations + '/*')
155159
].concat(getTemplateWatches());
156160

157-
gulp.watch(patternWatches).on('change', gulp.series(build, reload));
161+
gulp.watch(patternWatches, { awaitWriteFinish: true }).on('change', gulp.series(build, reload));
158162
}
159163

160164
gulp.task('patternlab:connect', gulp.series(function(done) {
@@ -186,8 +190,8 @@ gulp.task('patternlab:connect', gulp.series(function(done) {
186190
}
187191
}, function(){
188192
console.log('PATTERN LAB NODE WATCHING FOR CHANGES');
193+
done();
189194
});
190-
done();
191195
}));
192196

193197
/******************************************************

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "edition-node-gulp",
33
"description": "The gulp wrapper around patternlab-node core, providing tasks to interact with the core library and move supporting frontend assets.",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"dependencies": {
6-
"browser-sync": "^2.11.2",
6+
"browser-sync": "^2.0.0",
77
"gulp": "gulpjs/gulp#4.0",
88
"minimist": "^1.2.0",
99
"patternlab-node": "^2.0.0",

0 commit comments

Comments
 (0)