-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
97 lines (94 loc) · 2.25 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
module.exports = function (grunt) {
var port = grunt.option('port') || 8000;
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: 'jQuery.dotdotdot to AngularJS port'
},
coffee: {
compile: {
files: {
'js/angular.dotdotdot.js': 'src/angular.dotdotdot.coffee'
}
}
},
coffeelint: {
app: ['src/angular.dotdotdot.coffee'],
options: {
max_line_length: {
level: 'ignore'
}
}
},
less: {
development: {
options: {
paths: ["assets/css"]
},
files: {
"css/styles.css": "css/styles.less"
}
}
},
cssmin: {
development: {
files: {
'css/styles.min.css': ['css/styles.css']
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd h:M:stt") %> */\n'
},
build: {
src: 'js/angular.dotdotdot.js',
dest: 'js/angular.dotdotdot.min.js'
}
},
connect: {
server: {
options: {
index: ['index.html'],
port: port,
base: '.',
livereload: true,
open: true
}
}
},
watch: {
options: {
livereload: true
},
coffee: {
files: ['src/**/*.coffee'],
tasks: 'coffeegen'
},
cssmin: {
files: ['css/styles.less'],
tasks: 'cssgen'
},
js: {
files: ['Gruntfile.js', 'js/angular.dotdotdot.js'],
tasks: 'uglify'
},
html: {
files: ['index.html', 'angular.html']
}
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-coffeelint');
grunt.loadNpmTasks('grunt-contrib-watch');
// Code generators
grunt.registerTask('coffeegen', ['coffeelint', 'coffee', 'uglify']);
grunt.registerTask('cssgen', ['less', 'cssmin']);
// Final Generators
grunt.registerTask('build', ['coffeegen', 'cssgen']);
grunt.registerTask('serve', ['build', 'connect', 'watch']);
};