forked from nicolaspanel/numjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
101 lines (100 loc) · 2.5 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
'use strict';
module.exports = function (grunt) {
require('jit-grunt')(grunt, {
simplemocha: 'grunt-simple-mocha',
browserify: 'grunt-browserify'
});
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
simplemocha: {
options: {
reporter: 'spec',
timeout: '5000'
},
full: {
src: [
'test/mocha/**/*.spec.js'
]
}
},
browserify: {
dist: {
files: {
'dist/numjs.js': 'src/index.js'
}
},
options: {
browserifyOptions: {
standalone: 'nj'
}
}
},
// karma: {
// options: {
// frameworks: ['mocha', 'chai'],
// reporters: ['dots'],
// // web server port
// port: 9876,
// colors: true,
// logLevel: 'WARN',
// autoWatch: false,
// browsers: ['PhantomJS'],
// singleRun: true
// },
// min: {
// options: {
// files: [
// 'test/karma/phantom.js',
// // tested files
// 'dist/numjs.min.js',
// // tests files
// 'test/karma/*.spec.js',
// {pattern: 'data/**/*.png', watched: false, included: false, served: true}
// ]
// }
// },
// dist: {
// options: {
// files: [
// 'test/karma/phantom.js',
// 'dist/numjs.js',
// 'test/karma/*.spec.js',
// {pattern: 'data/**/*.png', watched: false, included: false, served: true}
// ]
// }
// }
// },
uglify: {
dist: {
options: {
banner: '/*! <%= pkg.name %> */\n'
},
files: {
'dist/numjs.min.js': 'dist/numjs.js'
}
}
},
jsdoc: {
dist: {
src: ['src/**/*.js', 'README.md'],
options: {
destination: 'doc'
// template : "node_modules/ink-docstrap/template",
// configure : "node_modules/ink-docstrap/template/jsdoc.conf.json"
}
}
},
'gh-pages': {
options: {
base: 'doc'
},
src: ['**']
}
});
grunt.registerTask('mocha', ['simplemocha:full']);
grunt.registerTask('build', ['browserify', 'uglify']);
grunt.registerTask('test', ['simplemocha:full', 'build']); //, 'karma:dist', 'karma:min']);
grunt.registerTask('travis', ['simplemocha:full', 'karma:dist', 'karma:min']);
grunt.registerTask('doc', ['jsdoc', 'gh-pages']);
};