-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
55 lines (50 loc) · 1.15 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
// magictimes Gruntfile
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
watch: {
files: ["app/app.js"],
tasks: ["uglify"]
},
// Uglify task info. Compress the js files.
uglify: {
options: {
mangle: true,
preserveComments: 'some'
},
my_target: {
files: {
'app/app.min.js': ['app/app.js']
}
}
},
// Validate JS code
jshint: {
options: {
jshintrc: '.jshintrc'
},
core: {
src: 'app/app.js'
},
pages: {
src: 'app/js/pages/*.js'
},
components: {
src: 'app/js/components/*.js'
}
}
});
// Load all grunt tasks
// Watch File Changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Compress JS Files
grunt.loadNpmTasks('grunt-contrib-uglify');
// Validate JS code
grunt.loadNpmTasks('grunt-contrib-jshint');
// Delete not needed files
grunt.loadNpmTasks('grunt-contrib-clean');
// Linting task
grunt.registerTask('lint', ['jshint']);
// The default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};