本文整理汇总了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));
}
示例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));
});
示例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))
});
示例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"));
});
示例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/'))
}
示例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);
}
示例7: src
task('minify-html-docs', ['api-docs'], () => {
return src('dist/docs/api/*.html')
.pipe(htmlmin(HTML_MINIFIER_OPTIONS))
.pipe(dest('dist/docs/api/'));
});
示例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));
});
示例9: src
task(`${taskName}:assets:html`, () => {
return src(htmlGlob).pipe(htmlmin(htmlMinifierOptions))
.pipe(dest(buildPackage.outputDir))
.pipe(dest(buildPackage.esm5OutputDir));
});
示例10: src
task('minified-api-docs', ['api-docs'], () => {
return src('dist/docs/api/*.html')
.pipe(htmlmin(htmlMinifierOptions))
.pipe(dest('dist/docs/api/'));
});