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


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

本文整理匯總了TypeScript中gulp-htmlmin.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

/**
 * Process HTML files.
 */
export default function (settings: IGulpSettings): any {
    "use strict";

    const htmlmin = require("gulp-htmlmin");
    const processHtml = require("gulp-processhtml");

    return settings.gulp
        .src([
            `${Constants.folders.src}/*.html`,
            `!${Constants.folders.src}/*.template.html`
        ])
        .pipe(processHtml())
        .pipe(htmlmin({
            collapseBooleanAttributes: true,
            collapseInlineTagWhitespace: true,
            collapseWhitespace: true,
            minifyCSS: true,
            minifyJS: true,
            minifyURLs: true,
            removeAttributeQuotes: true,
            removeComments: true,
            removeEmptyAttributes: true
        }))
        .pipe(settings.gulp.dest(Constants.folders.lib));
}
開發者ID:FullScreenShenanigans,項目名稱:gulp-shenanigans,代碼行數:28,代碼來源:html.ts

示例2:

gulp.task('production:html:minify', () => {
  return gulp
    .src(paths.output.index)
    .pipe(htmlreplace(config.htmlreplace))
    .pipe(inlinesource(config.inlinesource))
    .pipe(htmlmin(config.htmlmin))
    .pipe(gulp.dest(paths.build));
});
開發者ID:mogusbi,項目名稱:ts-starter,代碼行數:8,代碼來源:html.ts

示例3:

gulp.task('html-replace', () => {
    return gulp.src(webAppDir + '**/*.html')
        .pipe(newer(staticDir))
        .pipe(sourcemaps.init())
        .pipe(htmlmin({collapseWhitespace: true, caseSensitive: true}))
        .pipe(sourcemaps.write('/'))
        .pipe(gulp.dest(staticDir))
});
開發者ID:Nandtel,項目名稱:spring-boot-angular2-starter,代碼行數:8,代碼來源:gulpfile.ts

示例4:

gulp.task("resources:prod", () => {
    let htmlResult = gulp.src('src/**/*.html')
        .pipe(htmlmin({collapseWhitespace: true, caseSensitive: true}))
        .pipe(gulp.dest('dist'))

    let jsonResult = gulp.src('src/**/*.json')
        .pipe(jsonMinify())
        .pipe(gulp.dest('dist'))

    return gulp.src(["src/**/*", "!**/*.ts", '!**/*.html'])
        .pipe(gulp.dest("dist"));
});
開發者ID:nestis,項目名稱:widgetFrontAngular2,代碼行數:12,代碼來源:gulpfile.ts

示例5:

export const minHtml = (target: string): NodeJS.ReadWriteStream => {
  return gulp.src([
    `./src/${target}/**/*.html`,
    './src/components/directives/**/*.html'
  ])
    .pipe(minifyHtml({empty: true, quotes: true}))
    .pipe(ngTemplate({
      moduleName: 'tbTemplates',
      standalone: true,
      filePath: 'templates.js'
    }))
    .pipe(gulp.dest('./.tmp/scripts/template/'))
}
開發者ID:rucky2013,項目名稱:teambition-mobile-web,代碼行數:13,代碼來源:static.ts

示例6: optimize

export function optimize(options?: OptimizeOptions) {
  let transforms = [];

  if (options) {
    if (options.js && options.js.minify) {
      transforms.push(new UglifyTransform());
    }
    if (options.css && options.css.stripWhitespace) {
      transforms.push(cssSlam());
    }
    if (options.html) {
      transforms.push(gulpif(/\.html$/, htmlmin(options.html)));
    }
  }
  return compose(transforms);
}
開發者ID:frankisans,項目名稱:polymer-cli,代碼行數:16,代碼來源:optimize.ts

示例7: src

task('minify-html-docs', ['api-docs'], () => {
  return src('dist/docs/api/*.html')
    .pipe(htmlmin(HTML_MINIFIER_OPTIONS))
    .pipe(dest('dist/docs/api/'));
});
開發者ID:Promact,項目名稱:md2,代碼行數:5,代碼來源:docs.ts

示例8: src

task(':build:components:assets:minify', () => {
  return src('**/*.+(html|css)', { cwd: DIST_COMPONENTS_ROOT})
    .pipe(gulpIf(/.css$/, gulpMinifyCss(), gulpMinifyHtml(HTML_MINIFIER_OPTIONS)))
    .pipe(dest(DIST_COMPONENTS_ROOT));
});
開發者ID:JayKan,項目名稱:material2,代碼行數:5,代碼來源:components.ts

示例9: src

 task(`${taskName}:assets:html`, () => {
   return src(htmlGlob).pipe(htmlmin(htmlMinifierOptions))
       .pipe(dest(buildPackage.outputDir))
       .pipe(dest(buildPackage.esm5OutputDir));
 });
開發者ID:marffox,項目名稱:flex-layout,代碼行數:5,代碼來源:build-tasks-gulp.ts

示例10: src

task('minified-api-docs', ['api-docs'], () => {
  return src('dist/docs/api/*.html')
    .pipe(htmlmin(htmlMinifierOptions))
    .pipe(dest('dist/docs/api/'));
});
開發者ID:gnucoop,項目名稱:material2-extra,代碼行數:5,代碼來源:docs.ts


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