Answer the question
In order to leave comments, you need to log in
HTML files are not created from hbs, what should I do?
gulp(hbs):
const handlebars = require('gulp-compile-handlebars');
gulp.task('default', function () {
const options = {
ignorePartials: true,
batch : ['src/views/partials'],
helpers : {
capitals : function(str){
return str.toUpperCase();
}
}
}
return gulp.src('src/views/*.hbs')
.pipe(handlebars(options))
.pipe(gulp.dest('dist/'));
});
const exphbs = require('express-handlebars');
const homeRoutes = require('./src/routes/home.js');
const app = express();
const hbs = exphbs.create({
defaultLayout: 'main',
extname: 'hbs'
});
app.use('/', homeRoutes);
app.engine('hbs', hbs.engine);
app.set('view engine', 'hbs');
app.set('views', 'views');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question