本文整理汇总了TypeScript中gulp-inject.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: pipelineFunction
export default function pipelineFunction() {
let transform = (filepath, file, index, length) => {
var path = Path.normalize('.' + filepath);
var application = Path.normalize(root.path());
var tsfile = Path.relative(application, path);
var jsfile = tsfile.replace(/\\/g, '/').replace('.ts', '.js');
return `+script("${jsfile}")`;
};
var jsOptions = {
starttag: '//js',
endtag: '//end-js',
transform: transform
};
var application = root.application;
var controller = new file(application.path(), '/js/**/*.ts');
var controllerSource: string[] = [
controller.toString(),
new file(application.path(), '/**/*.d.ts').Not()
];
return gulp.src(root.application.jadeScripts().toString())
.pipe(inject(gulp.src(controllerSource, { read: false }), jsOptions))
.pipe(gulp.dest(root.path()));
};
示例2:
gulp.task('index', () => {
return gulp.src('./app/index.html')
.pipe(inject(gulp.src(['**/*.js', '**/*.css', '!bower_components/**/*'], {
cwd: release ? RELEASE_DIR : BUILD_DIR,
read: false
})))
.pipe(gulp.dest(release ? RELEASE_DIR : BUILD_DIR));
});
示例3:
() => {
let vendors = gulp.src(DEST_DIR + '/' + ADMIN_NAMESPACE + '/vendor.js', {read: false});
let sources = gulp.src([
DEST_DIR + '/' + ADMIN_NAMESPACE + '/*.js',
DEST_DIR + '/' + ADMIN_NAMESPACE + '/app/vendor.css',
DEST_DIR + '/' + ADMIN_NAMESPACE + '/**/*.css',
'!' + DEST_DIR + '/' + ADMIN_NAMESPACE + '/vendor.js'
], {read: false});
return gulp.src(DEST_DIR + '/' + ADMIN_NAMESPACE + '/index.*')
.pipe(inject(vendors, {name: 'vendors', relative: true}))
.pipe(inject(sources, {relative: true, addRootSlash: true}))
.pipe(gulp.dest(DEST_DIR + '/' + ADMIN_NAMESPACE));
}
示例4: function
gulp.task('gen-ts-refs', () => {
var target = gulp.src(config.appTypeScriptReferences);
var sources = gulp.src([config.allTypeScript], {read: false});
return target.pipe(inject(sources, {
starttag: '//{',
endtag: '//}',
transform: function (filepath) {
return '/// <reference path="../..' + filepath + '" />';
}
})).pipe(gulp.dest(config.typings));
});
示例5: require
gulp.task('inject', () => {
var wiredep = require('wiredep').stream;
var wiredepOptions = {
bowerJson: require('./bower.json'),
directory: './public/lib',
ignorePath: '../../public'
}
var inject = require('gulp-inject');
var injectSrc = gulp.src(['./public/css/*.css', './public/js/*.js', './public/js/*/*.js'], {read: false});
var injectOptions = {
ignorePath: "/public"
}
return gulp.src(['src/views/*.html'])
.pipe(wiredep(wiredepOptions))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest('src/views'));
});