-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
executable file
·55 lines (49 loc) · 1.56 KB
/
gulpfile.js
File metadata and controls
executable file
·55 lines (49 loc) · 1.56 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
43
44
45
46
47
48
49
50
51
52
53
54
55
var gulp = require('gulp');
var vulcanize = require('gulp-vulcanize');
var clean = require('gulp-clean');
var imagemin = require('gulp-imagemin');
var dist_path = 'dist/'
gulp.task('vulcanize', ['clean'], function() {
return gulp.src('custom_components/cvMainComponent.html')
.pipe(vulcanize({
excludes: [
'bower_components/polymer/polymer.html'
],
stripExcludes: false,
inlineScripts: true,
inlineCss: true,
implicitStrip: true,
stripComments: true
}))
.pipe(gulp.dest(dist_path + 'custom_components/'));
});
gulp.task('copy', ['vulcanize'], function () {
gulp.src('index.html')
.pipe(gulp.dest(dist_path));
gulp.src('404.html')
.pipe(gulp.dest(dist_path));
gulp.src('css/*.css')
.pipe(gulp.dest(dist_path + 'css/'));
gulp.src('.htaccess')
.pipe(gulp.dest(dist_path));
gulp.src('robots.txt')
.pipe(gulp.dest(dist_path));
gulp.src('sitemap.xml')
.pipe(gulp.dest(dist_path));
gulp.src('json/**/*.json')
.pipe(gulp.dest(dist_path + 'json/'));
gulp.src('bower_components/**/*')
.pipe(gulp.dest(dist_path + 'bower_components/'));
gulp.src('custom_behaviors/*.html')
.pipe(gulp.dest(dist_path + 'custom_behaviors/'));
});
gulp.task('clean', function() {
return gulp.src(dist_path)
.pipe(clean());
});
gulp.task('images', ['clean'], function(){
return gulp.src('images/*')
.pipe(imagemin())
.pipe(gulp.dest(dist_path + 'images/'))
})
gulp.task('default', ['clean', 'images', 'vulcanize', 'copy']);