forked from supertitanoboa/mementos-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
75 lines (66 loc) · 1.78 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
67
68
69
70
71
72
73
74
75
// include gulp
var gulp = require('gulp');
// include plugins
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var concatCss = require('gulp-concat-css');
var rename = require('gulp-rename');
var jshint = require('gulp-jshint');
/*old testing framework
var mocha = require('gulp-mocha');*/
var karma = require('gulp-karma');
var shell = require('gulp-shell');
// the paths to our app files
var paths = {
scripts: 'client/www/app/**/*.js',
appRoot: 'client/www/app/',
html: 'client/www/app/**/*.html',
test: 'client/www/test/**/*.js',
sass: 'client/www/content/sass/**/*.scss',
sassRoot: 'client/www/content/sass/',
css: 'client/www/content/css/**/*.css',
cssRoot: 'client/www/content/css/'
};
// run linting
gulp.task('lint', function(done) {
'use strict';
return gulp.src(['gulpfile.js', paths.scripts])
.pipe(jshint())
.pipe(jshint.reporter('default'), done);
});
/*// old run tests
gulp.task('mocha', function(done) {
'use strict';
return gulp.src(paths.test)
.pipe(mocha({reporter: 'spec'}), done);
});*/
// new run tests
gulp.task('karma', function() {
return gulp.src('./foobar') //
.pipe(karma({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
throw err;
});
});
// compile sass
gulp.task('sass', function(done) {
gulp.src(paths.sass)
.pipe(sass())
.pipe(concatCss('app.css'))
// .pipe(minifyCss({
// keepSpecialComments: 0
// }))
.pipe(gulp.dest(paths.cssRoot))
});
// run tests
gulp.task('test', ['karma']);
// FIXME: edit to watch all appropriate files
gulp.task('watch', function() {
'use strict';
gulp.watch(paths.sass, ['sass']);
});
// FIXME: to run all appropriate tasks on start
gulp.task('default', ['sass']);