-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·98 lines (83 loc) · 1.67 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
module.exports = function(grunt) {
var npm_tasks
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
main: {
files: ['src/NEngine/**/*.js', '!src/NEngine/**/*.test.js',
'src/browser.js'],
tasks: ['compile']
},
less: {
files: 'example/**/*.less',
tasks: ['less:dev']
}
},
nodemon: {
dev: {
script: 'example/dev.js'
},
expo: {
script: 'example/dev.js'
}
},
import: {
main: {
src: 'src/browser.js',
dest: 'dist/NEngine.js'
}
},
less: {
dev: {
options: {},
files: [{
expand: true,
src: ['example/**/style.less'],
ext: '.css',
extDot: 'last',
}]
}
},
jsdoc : {
dist : {
src:['./dist/*.js'],
jsdoc: './node_modules/.bin/jsdoc',
options: {
destination: './doc',
configure: './jsdoc.json',
template: './node_modules/minami'
}
}
},
focus: {
dev: {
include: ['main', 'less']
},
},
karma: {
dev: {
configFile: 'karma.conf.js',
client: {
captureConsole: false,
}
}
},
concurrent: {
dev: {
tasks: ['focus:dev', 'nodemon:dev' , 'karma:dev'],
options: {
logConcurrentOutput: true
}
}
}
})
npm_tasks = ['grunt-import', 'grunt-contrib-watch',
'grunt-jsdoc', 'grunt-contrib-copy', 'grunt-focus',
'grunt-nodemon', 'grunt-concurrent', 'grunt-karma',
'grunt-contrib-less',]
npm_tasks.forEach(function(e){grunt.loadNpmTasks(e)})
grunt.registerTask('compile', ['import:main', 'jsdoc', 'less:dev'])
grunt.registerTask('expo', ['compile', 'nodemon:expo'])
grunt.registerTask('dev', ['compile:dev','concurrent:dev'])
grunt.registerTask('default', 'dev')
}