forked from passy/autoprefixer-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (33 loc) · 1.01 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
var gulp = require('gulp');
var fs = require('fs-extra');
gulp.task('clean', function (done) {
fs.remove(__dirname + '/build', done);
});
gulp.task('lint', function () {
var jshint = require('gulp-jshint');
return gulp.src(['index.js', 'test/*.js', 'gulpfile.js'])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('build', ['clean'], function () {
var webpack = require('gulp-webpack');
return gulp.src('')
.pipe(webpack({
target: 'node',
context: __dirname + '/test/',
entry: './test.js',
output: {
path: __dirname + '/build/',
filename: "test.js",
}
}))
.pipe(gulp.dest('build/'));
});
gulp.task('test', ['build'], function () {
var mocha = require('gulp-mocha');
require('should');
return gulp.src('build/*.js', { read: false })
.pipe(mocha());
});
gulp.task('default', ['lint', 'test']);