-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
45 lines (37 loc) · 1.09 KB
/
Gruntfile.js
File metadata and controls
45 lines (37 loc) · 1.09 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
build: {
src: 'lib/index.js',
dest: 'build/index.js'
},
instrumented: {
src: 'coverage/lib/index.js',
dest: 'coverage/build/index.js'
},
options: {
standalone: 'CircularList'
},
},
instrument: {
files: 'lib/**/*.js',
options: {
basePath: 'coverage/'
}
},
});
// Grunt plugins must have been included in the
// project and saved to the devDependencies
// list in the package.json, e.g. by using
// npm install <plugin name> --save-dev
// Creates browserify task.
grunt.loadNpmTasks('grunt-browserify');
// Creates instrument task (amongst others).
grunt.loadNpmTasks('grunt-istanbul');
// Default task. Build the project.
grunt.registerTask('default', ['browserify:build']);
// Custom tasks. Instrument and build into the test directory.
grunt.registerTask('build-instrumented', ['instrument', 'browserify:instrumented']);
};