diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-08-10 22:37:35 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-08-10 22:37:35 +0900 |
| commit | e21f4d3a5bd847798a4afaa91ce7e6699c6f2f7a (patch) | |
| tree | 7b2974ac06b045cdcfcbc21c8cb6ec644acbf18a /gulpfile.ts | |
| parent | Fix typescript (diff) | |
| download | sharkey-e21f4d3a5bd847798a4afaa91ce7e6699c6f2f7a.tar.gz sharkey-e21f4d3a5bd847798a4afaa91ce7e6699c6f2f7a.tar.bz2 sharkey-e21f4d3a5bd847798a4afaa91ce7e6699c6f2f7a.zip | |
#675
Diffstat (limited to 'gulpfile.ts')
| -rw-r--r-- | gulpfile.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gulpfile.ts b/gulpfile.ts index 55452fe7f0..87c3a23a01 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -18,6 +18,7 @@ import imagemin = require('gulp-imagemin'); import * as rename from 'gulp-rename'; import * as mocha from 'gulp-mocha'; import * as replace from 'gulp-replace'; +import * as htmlmin from 'gulp-htmlmin'; const uglifyes = require('uglify-es'); import version from './src/version'; @@ -161,5 +162,31 @@ gulp.task('build:client:pug', [ themeColor: constants.themeColor } })) + .pipe(htmlmin({ + // 真理値属性の簡略化 e.g. + // <input value="foo" readonly="readonly"> to + // <input value="foo" readonly> + collapseBooleanAttributes: true, + + // テキストの一部かもしれない空白も削除する e.g. + // <div> <p> foo </p> </div> to + // <div><p>foo</p></div> + collapseWhitespace: true, + + // (できる場合は)属性のクォーテーション削除する e.g. + // <p class="foo-bar" id="moo" title="blah blah">foo</p> to + // <p class=foo-bar id=moo title="blah blah">foo</p> + removeAttributeQuotes: true, + + // 省略可能なタグを省略する e.g. + // <html><p>yo</p></html> ro + // <p>yo</p> + removeOptionalTags: true, + + // 属性の値がデフォルトと同じなら省略する e.g. + // <input type="text"> to + // <input> + removeRedundantAttributes: true + })) .pipe(gulp.dest('./built/web/app/')) ); |