Skip to content
Snippets Groups Projects
Commit 76771728 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix gulp compile script (watch)

parent fcd412e3
No related branches found
No related tags found
No related merge requests found
...@@ -53,21 +53,20 @@ const paths = { ...@@ -53,21 +53,20 @@ const paths = {
function appAndPluginWatch(done) { function appAndPluginWatch(done) {
log(colors.green('Watching source files...')); log(colors.green('Watching source files...'));
const watchDone = () => {};
// Licenses // Licenses
gulp.watch(paths.license_md, () => appLicense(watchDone)); gulp.watch(paths.license_md, () => appLicense());
// App // App
gulp.watch(paths.sass, () => appSass(watchDone)); gulp.watch(paths.sass, () => appSass());
gulp.watch(paths.templatecache, () => appNgTemplate(watchDone)); gulp.watch(paths.templatecache, () => appNgTemplate());
gulp.watch(paths.ng_annotate, (event) => appNgAnnotate(watchDone, event)); gulp.watch(paths.ng_annotate, (event) => appNgAnnotate(event));
gulp.watch(paths.ng_translate, () => appNgTranslate(watchDone)); gulp.watch(paths.ng_translate, () => appNgTranslate());
// Plugins // Plugins
gulp.watch(paths.templatecache_plugin, () => pluginNgTemplate(watchDone)); gulp.watch(paths.templatecache_plugin, () => pluginNgTemplate());
gulp.watch(paths.ng_annotate_plugin, () => pluginNgAnnotate(watchDone, event)); gulp.watch(paths.ng_annotate_plugin, (event) => pluginNgAnnotate(event));
gulp.watch(paths.ng_translate_plugin, (event) => pluginNgTranslate(watchDone)); gulp.watch(paths.ng_translate_plugin, () => pluginNgTranslate());
gulp.watch(paths.css_plugin.concat(paths.leafletSass), () => pluginSass(watchDone)); gulp.watch(paths.css_plugin.concat(paths.leafletSass), () => pluginSass());
done(); done();
} }
...@@ -141,7 +140,7 @@ function appNgTemplate() { ...@@ -141,7 +140,7 @@ function appNgTemplate() {
.pipe(gulp.dest('./www/dist/dist_js/app')); .pipe(gulp.dest('./www/dist/dist_js/app'));
} }
function appNgAnnotate(done, changes) { function appNgAnnotate(changes) {
// If watch, apply only on changes files // If watch, apply only on changes files
if (changes && changes.type === 'changed' && changes.path && changes.path.indexOf('/www/js/') !== -1) { if (changes && changes.type === 'changed' && changes.path && changes.path.indexOf('/www/js/') !== -1) {
...@@ -199,7 +198,7 @@ function pluginNgTemplate() { ...@@ -199,7 +198,7 @@ function pluginNgTemplate() {
.pipe(gulp.dest('./www/dist/dist_js/plugins')); .pipe(gulp.dest('./www/dist/dist_js/plugins'));
} }
function pluginNgAnnotate(done, event) { function pluginNgAnnotate(event) {
// If watch, apply only on changes files // If watch, apply only on changes files
if (event && event.type === 'changed' && event.path && event.path.indexOf('/www/js/') !== -1) { if (event && event.type === 'changed' && event.path && event.path.indexOf('/www/js/') !== -1) {
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
"cordova": {} "cordova": {}
}, },
"watchPatterns": [ "watchPatterns": [
"www/index.html",
"www/api/index.html",
"www/dist/**/*", "www/dist/**/*",
"www/css/*.css" "www/css/*.css"
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment