twig - gulp-data results in empty html -


the views:build task includes templates before data gets injected, resulting in blank html page. doing wrong?

this code:

gulp.task('views:build', ['views:templates'] , () => {   return gulp.src(config.views.src + '*.twig')       .pipe($.data(function() {         return json.parse(fs.readfilesync('src/data/timber.json'))       })) // load data base json file       .pipe($.twig())       .pipe(gulp.dest(config.views.tmp))       .pipe(reload({stream: true})); });  gulp.task('views:templates', () => {   return gulp.src(config.views.src + 'templates/*.twig')       .pipe($.data(function(file) {         return json.parse(fs.readfilesync('src/data/' + path.basename(file.path).replace('.twig', '')  + '.json'));       }))       .pipe($.twig())       .pipe(gulp.dest(config.views.tmp)) }); 


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -