-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
70 lines (61 loc) · 1.46 KB
/
gulpfile.js
File metadata and controls
70 lines (61 loc) · 1.46 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict'
const gulp = require('gulp')
const minifyHtml = require('gulp-minify-html')
const concat = require('gulp-concat')
const uglify = require('gulp-uglify')
const haml = require('gulp-ruby-haml')
var coffee = require('gulp-coffee');
var sass = require('gulp-sass');
sass.compiler = require('node-sass');
/**
* Paths configuration, easy to change and/or use in multiple tasks
*/
const paths = {
javascripts: [
'./app/**/*.coffee'
],
templates: [
'./app/**/*.haml',
],
scss: [
'./app/**/*.scss'
],
destination: [
'./app/dist/'
]
}
gulp.task('sass', function (done) {
return gulp.src(paths.scss)
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest(paths.destination));
done()
});
gulp.task('coffeescript', function(done) {
gulp.src(paths.javascripts)
.pipe(coffee({bare: true}))
.pipe(gulp.dest(paths.destination));
done();
});
/**
* Takes html templates and transform them to angular templates (javascript)
*/
gulp.task('templates', function(done) {
return gulp.src(paths.templates)
.pipe(haml())
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(gulp.dest(paths.destination))
done();
})
/**
* The command `gulp` will resolve in `gulp scripts`
*/
gulp.task('build', gulp.parallel('templates', 'coffeescript', 'sass'));
// an alias.
// gulp.task('default', gulp.parallel('build'));
gulp.task('default', gulp.series('build'), function() {
console.log("DDD")
})