-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
89 lines (87 loc) · 2.93 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
module.exports = function(grunt) {
var jsLocation = 'public/assets/js',
cssLocation = 'public/assets/css';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
wiredep: {
target: {
src: 'public/index.html'
}
},
jsbeautifier: {
files: ['<%= jshint.files%>'],
options: {}
},
jshint: {
reporter: require('jshint-stylish'),
jshintrc: ".jshintrc",
files: ['Gruntfile.js', 'app.js', 'public/assets/js/src/**.js']
},
less: {
development: {
options: {
compress: true,
sourceMap: true,
sourceMapURL: "assets/css/style.min.css.map",
sourceMapBasepath: "public"
},
files: {
"public/assets/css/style.min.css": "public/assets/css/src/style.less"
}
}
},
watch: {
javascripts: {
files: ['<%= jshint.files %>'],
tasks: ['build-develop']
},
css: {
files: [cssLocation + '/src/*.less'],
tasks: ['less']
},
karma: {
files: ['tests/']
}
},
uglify: {
my_target: {
files: {
'public/assets/js/datatables-generator.min.js': [jsLocation + '/src/datatables-generator.js', jsLocation + '/src/utils.js']
},
options: {
sourceMap: true,
sourceMapName: 'public/assets/js/sourcemap.map'
}
}
},
jsdoc: {
dist: {
src: ['public/assets/js/src/*.js'],
options: {
destination: 'public/doc',
template: 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
configure: 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template/jsdoc.conf.json'
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-wiredep');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-karma');
//the main task to use during development
grunt.registerTask('build-develop', ['wiredep', 'jsbeautifier', 'jshint', 'jsdoc', 'karma', 'less', 'uglify', 'watch']);
//verify tests quickly
grunt.registerTask('test', ['karma:unit']);
//production builds.
grunt.registerTask('default', ['wiredep', 'jsdoc', 'less', 'uglify']);
};