-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
42 lines (35 loc) · 913 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
34
35
36
37
38
39
40
41
42
var gulp = require("gulp"),
babel = require("gulp-babel"),
karma = require('karma').server,
rename = require("gulp-rename"),
watch = require("gulp-watch"),
color = require("colors");
/**
* Compile ES6 to ES5 with Babel.js
*/
gulp.task("babel", function () {
watch('src/smacss.es6.js', function () {
console.log("Compiling " + "smacss.es6.js".green)
gulp.src("src/smacss.es6.js")
.pipe(babel())
.pipe(rename("smacss.js"))
.pipe(gulp.dest("dist"));
});
});
/**
* Run test once and exit
*/
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/test/run.js',
singleRun: true
}, done);
});
/**
* Watch for file changes and re-run tests on each change
*/
gulp.task('tdd', function (done) {
karma.start({
configFile: __dirname + '/test/run.js',
}, done);
});