How to use the precompile function from gulp-template

Find comprehensive JavaScript gulp-template.precompile code examples handpicked from public code repositorys.

6
7
8
9
10
11
12
13
14
15
// Compile all *.ejs files to pre-compiled templates and append *.js to the filename.
gulp.task('templates', () =>
    gulp
        .src('./src/**/*.ejs')
        .pipe(
            template.precompile({
                evaluate: /\{%([\s\S]+?)%\}/g,
                interpolate: /\{\{([\s\S]+?)\}\}/g,
                escape: /\{\{\{([\s\S]+?)\}\}\}/g,
                variable: 'ctx',
fork icon2
star icon0
watch icon0

+ 3 other calls in file