-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
executable file
·63 lines (55 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
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
uglify: {
options: {
sourceMap: 'static/js/source-map.js',
sourceMapRoot: "",
sourceMappingURL: 'static/js/source-map.js'
},
build: {
src: ['static/js/**/**.js', '!static/js/angel-news-hub.min.js'],
dest: 'static/js/angel-news-hub.min.js'
}
},
jshint: {
test: {
src: ['static/js/**.js', 'modules/**/*.js', 'app.js', 'config.js', '!static/js/bootstrap/*', '!static/js/*.min.js', '!static/js/source-map.js']
}
},
less: {
dev: {
files: {
"static/css/styles.css": "static/less/styles.less",
"static/css/bootstrap.css": "static/less/bootstrap/bootstrap.less"
}
},
production: {
options: {
yuicompress: true
},
files: {
"static/css/styles.min.css": "static/less/styles.less"
}
}
},
watch: {
dev: {
files: ['app.js', 'config.js', 'static/js/**/*.js', 'modules/**/*.js', 'static/less/**/*.less', '!*.css', '**/*.jade', 'static/**/*.html', '**/*.json', '!node_modules/'],
tasks: ['less', 'jshint:test'],
options: {
livereload: true,
},
},
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-notify');
// JS distribution task.
grunt.registerTask('default', ['jshint:test', 'less:dev', 'watch:dev']);
grunt.registerTask('css', ['less:dev']);
};