-
Notifications
You must be signed in to change notification settings - Fork 63
/
gulpfile.js
66 lines (54 loc) · 1.96 KB
/
gulpfile.js
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
'use strict';
var gulp = require('gulp');
var filters = require('gulp-filter');
var insert = require('gulp-insert');
var sass = require('gulp-sass');
var merge = require('merge-stream');
var vulcanize = require('gulp-vulcanize');
var $ = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
var filter = filters(['*', '!app/css/skins/color-vars-template.scss', '!app/css/skins/skin-template.scss']);
gulp.task('sass', function () {
gulp.src('./app/**/*.scss')
.pipe(filter)
.pipe(sass().on('error', sass.logError))
});
gulp.task('sass:watch', function () {
gulp.watch('./app/**/*.scss', ['sass'])
.pipe(filter);
});
gulp.task('insert', function(){
gulp.src(['app/css/skins/default/color-vars-body.css',
'app/css/skins/default/color-vars.css'])
.pipe(insert.append('</style>'))
.pipe(insert.prepend("<style is=\"custom-style\">"));
});
gulp.task('copy', function () {
var bower = gulp.src([
'bower_components/**/*'
]).pipe(gulp.dest('app/bower_components'));
var vulcanized = gulp.src(['app/components/pd-dashboard/pd-dashboard.html'])
.pipe($.rename('pd-dashboard.vulcanized.html'))
.pipe(gulp.dest('app/components/pd-dashboard'));
return merge(bower);
});
gulp.task('vulcanize', function () {
return gulp.src('../app/components/pd-dashboard/pd-dashboard.vulcanized.html')
.pipe(vulcanize({
abspath: '',
excludes: ['../bower_components/polymer/polymer.html',
'../app/bower_components/polymer/polymer.html'
],
stripExcludes: false
}))
.pipe(gulp.dest('../app/components/pd-dashboard'));
});
gulp.task('precache', function (callback) {
});
gulp.task('default', function (cb) {
runSequence(
['sass','insert', 'copy'],
'vulcanize', 'precache',
cb)
});
require('web-component-tester').gulp.init(gulp);