-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
33 lines (28 loc) · 942 Bytes
/
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
var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var csso = require('gulp-csso');
var jsmin = require('gulp-jsmin');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
gulp.task('html', function() {
return gulp.src('./src/index.html')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('./dist'));
});
gulp.task('css', function() {
return gulp.src('./src/css/main.css')
.pipe(csso())
.pipe(gulp.dest('./dist/css'));
});
gulp.task('jsmin', function() {
return gulp.src('./src/js/neighbourhoodMap.js')
.pipe(jsmin())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('./dist/js'));
});
gulp.task('htmlreplace', ['html'], function() {
return gulp.src('./dist/index.html')
.pipe(replace('neighbourhoodMap.js', 'neighbourhoodMap.min.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('default', ['html', 'css', 'jsmin', 'htmlreplace']);