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