forked from acvetkov/fake-request
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
60 lines (50 loc) · 1.39 KB
/
Gruntfile.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
module.exports = function (grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: require('./package.json')
});
grunt.config('webpack.build', {
entry: './src/fake-request.js',
output: {
path: 'build/',
filename: 'fake-request.<%=pkg.version%>.js',
libraryTarget: 'umd',
library: 'http'
}
});
grunt.config('uglify.build', {
files: {
'build/fake-request.<%=pkg.version%>.min.js': ['build/fake-request.<%=pkg.version%>.js']
}
});
grunt.config('clean.build', {
src: [
'build/*.js',
'!build/*.min.js'
]
});
grunt.config('jscs.build', {
src: 'src/**/*.js',
options: {
config: '.jscsrc',
reporter: 'console'
}
});
grunt.config('jshint', {
options: {
jshintrc: true,
reporter: require('jshint-stylish')
},
build: 'src/**/*.js'
});
grunt.config('mochaTest.request', {
src: [
'test/**/*.js'
]
});
grunt.registerTask('test', ['mochaTest:request']);
grunt.registerTask('code', ['jshint:build', 'jscs']);
grunt.registerTask('build', ['webpack:build', 'uglify:build', 'clean:build']);
grunt.registerTask('default', ['code', 'test', 'build']);
};