browserify で gulp を使用していますが、brfs-htmlmin を設定するにはどうすればよいですか? npmページで、options.minifyオブジェクトを渡す必要があることがわかりましたが、browserifyを使用してそれを行うにはどうすればよいですか?
これはうまくいきません、ヒントはありますか?(はい、私は新しいです。昨日 node/npm をインストールしました;)
gulp.task('scripts', ['clean'], function () {
gulp.src('Components/initialize.js')
.pipe(browserify({
transform: ['brfs-htmlmin', { "opts": {minify: {removeComments: false}} }]
}))
.pipe(gulp.dest('./buildjs'));
});
最後に brfs-htmlmin ソースを変更しましたが、もっと良い方法があるはずです
brfs-htmlmin ソース:
module.exports = function(file, opts) {
if(/\.json$/.test(file)) return through();
opts = opts || {};
opts.minify = opts.minify || {
removeComments: false,
collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
removeEmptyAttributes: true
};