This repository was archived by the owner on Nov 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
42 lines (39 loc) · 1.28 KB
/
gulpfile.js
File metadata and controls
42 lines (39 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* global require */
let gulp = require('gulp');
let autoPrefix = require('autoprefixer');
let cssNano = require('cssnano');
let htmlMin = require('gulp-htmlmin');
let postCssHtml = require('gulp-html-postcss');
gulp.task('compress-components', function() {
return gulp.src('src/components/*-*.html')
.pipe(htmlMin({
removeComments: true,
preventAttributesEscaping: true,
collapseWhitespace: true,
minifyJS: true,
}))
.pipe(postCssHtml([
autoPrefix,
cssNano({safe: true}),
]))
.pipe(gulp.dest('components'));
});
gulp.task('publish', ['compress-components'], function() {
return gulp.src([
'bower_components/iron-*/*.html',
'bower_components/paper-*/*.html',
'bower_components/google-*/*.html',
'bower_components/gold-*/*.html',
'bower_components/neon-*/*.html',
'bower_components/platinum-*/*.html',
'bower_components/polymer/*.html',
], {base: 'bower_components'})
.pipe(htmlMin({
removeComments: true,
preventAttributesEscaping: true,
collapseWhitespace: true,
minifyJS: true,
minifyCSS: true,
}))
.pipe(gulp.dest('bower_components'));
});