本文整理匯總了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'));
});