當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript gulp-inject.default函數代碼示例

本文整理匯總了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()));
};
開發者ID:ibzakharov,項目名稱:angular_project_template,代碼行數:28,代碼來源:inject-scripts.ts

示例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));
});
開發者ID:ngbinh,項目名稱:angular-typescript,代碼行數:8,代碼來源:gulpfile.ts

示例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));

    }
開發者ID:lindsaymacvean,項目名稱:seventag,代碼行數:17,代碼來源:Gulpfile.ts

示例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));
});
開發者ID:Billbrockbank,項目名稱:sp-o365-rest,代碼行數:11,代碼來源:gulpfile.ts

示例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'));
});
開發者ID:Stieve,項目名稱:Hackathon2016,代碼行數:19,代碼來源:gulpfile.ts


注:本文中的gulp-inject.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。