-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
48 lines (45 loc) · 1.38 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
'use strict';
var gulp = require('gulp');
var vulcanize = require('gulp-vulcanize');
var replace = require('gulp-replace');
var minifyHTML = require('gulp-minify-html');
var minifyInline = require('gulp-minify-inline');
var rename = require('gulp-rename');
var debug = require('gulp-debug');
var FILE = 'sweva-visualization-graph.html'
gulp.task('pack', function () {
return gulp.src(FILE)
.pipe(replace(/<link.*.html">/g, ''))
.pipe(replace(/"\.\.\//g, '"../bower_components/'))
.pipe(replace(/"\.\//g, '"../'))
.pipe(gulp.dest('dist'))
.pipe(vulcanize({
stripComments: true,
inlineCss: true,
inlineScripts: false
}))
.pipe(minifyInline())
.pipe(minifyHTML({
quotes: true,
empty: true,
spare: true
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('dist'))
});
gulp.task('packdev', function () {
return gulp.src(FILE)
.pipe(replace(/<link.*.html">/g, ''))
.pipe(replace(/"\.\.\//g, '"../bower_components/'))
.pipe(replace(/"\.\//g, '"../'))
.pipe(gulp.dest('dist'))
.pipe(vulcanize({
stripComments: true,
inlineCss: true,
inlineScripts: true
}))
.pipe(gulp.dest('dist'))
});
gulp.task('build', ['pack', 'packdev']);