本文整理匯總了TypeScript中gulp-template.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了default函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: html2js
() => {
var filename = debuggerIndexFile,
filePath = path.resolve(__dirname, filename),
source = fs.readFileSync(filePath, 'utf8');
var tpl = html2js(source, {
mode: 'default',
wrap: false
});
return gulp.src(SOURCE_DIR + '/' + DEBUGGER_NAMESPACE + '/debug.js')
.pipe(template({
template: tpl
}))
.pipe(gulpif(minify, uglify()))
.pipe(gulpif(env === 'dev', replace(/##host##/g, `${baseUrl}container-debugger`)))
.pipe(gulp.dest(DEST_DIR + '/' + DEBUGGER_NAMESPACE));
}
示例2: cb
], answers => {
if (!answers.good) { return cb(); }
answers.camel = Util.camelize(answers.service);
answers.mod = Util.classable(answers.camel);
gulp.src(path.join(__dirname, 'templates/options/service/service.ts'))
.pipe(template(answers))
.pipe(rename(file => { file.basename = answers.camel; }))
.pipe(conflict(path.join(process.cwd(), 'src/shared')))
.pipe(gulp.dest(path.join(process.cwd(), 'src/shared')))
.on('finish', () => { cb(); }).resume();
});
示例3: filter
], answers => {
if (!answers.good) { return cb(); }
answers.camel = Util.camelize(answers.project);
answers.slug = Util.slugify(answers.project);
path.resolve(process.cwd(), answers.slug);
let img = filter(['**/**', '!**/**.{ico,png}'], {restore: true});
gulp.src(path.join(__dirname, 'templates/app/**'))
.pipe(img)
.pipe(template(answers))
.pipe(img.restore)
.pipe(conflict(path.join(process.cwd(), answers.slug)))
.pipe(gulp.dest(path.join(process.cwd(), answers.slug)))
.pipe(install())
.on('finish', () => { cb(); }).resume();
});