Commit 5d1782a30395daa942c6109f793346596e2b9390
1 parent
c3af8dfc
Exists in
master
and in
1 other branch
Allow themes to override templates
Showing
3 changed files
with
15 additions
and
6 deletions
Show diff stats
gulp/build.js
| ... | ... | @@ -10,10 +10,11 @@ var $ = require('gulp-load-plugins')({ |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | 12 | gulp.task('partials', function () { |
| 13 | - return gulp.src([ | |
| 14 | - path.join(conf.paths.src, '/app/**/*.html'), | |
| 15 | - path.join(conf.paths.tmp, '/serve/app/**/*.html') | |
| 16 | - ]) | |
| 13 | + var srcPaths = [path.join(conf.paths.tmp, '/serve/app/**/*.html')]; | |
| 14 | + conf.paths.allSources.forEach(function(src) { | |
| 15 | + srcPaths.push(path.join(src, '/app/**/*.html')); | |
| 16 | + }); | |
| 17 | + return gulp.src(srcPaths) | |
| 17 | 18 | .pipe($.minifyHtml({ |
| 18 | 19 | empty: true, |
| 19 | 20 | spare: true, | ... | ... |
gulp/server.js
| ... | ... | @@ -46,7 +46,11 @@ browserSync.use(browserSyncSpa({ |
| 46 | 46 | })); |
| 47 | 47 | |
| 48 | 48 | gulp.task('serve', ['watch'], function () { |
| 49 | - browserSyncInit([path.join(conf.paths.tmp, '/serve'), conf.paths.src]); | |
| 49 | + var srcPaths = [path.join(conf.paths.tmp, '/serve')]; | |
| 50 | + conf.paths.allSources.reverse().forEach(function(src) { | |
| 51 | + srcPaths.push(src); | |
| 52 | + }); | |
| 53 | + browserSyncInit(srcPaths); | |
| 50 | 54 | }); |
| 51 | 55 | |
| 52 | 56 | gulp.task('serve:dist', ['build'], function () { | ... | ... |
gulp/watch.js
| ... | ... | @@ -33,7 +33,11 @@ gulp.task('watch', ['inject'], function () { |
| 33 | 33 | } |
| 34 | 34 | }); |
| 35 | 35 | |
| 36 | - gulp.watch(path.join(conf.paths.src, '/app/**/*.html'), function(event) { | |
| 36 | + var watchPaths = []; | |
| 37 | + conf.paths.allSources.forEach(function(src) { | |
| 38 | + watchPaths.push(path.join(src, '/app/**/*.html')); | |
| 39 | + }); | |
| 40 | + gulp.watch(watchPaths, function(event) { | |
| 37 | 41 | browserSync.reload(event.path); |
| 38 | 42 | }); |
| 39 | 43 | }); | ... | ... |