-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
68 lines (62 loc) · 1.79 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
module.exports = function(grunt) {
/** ToDo :
// Fix uncss ignoring underscore templates selectors
*/
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), // reads package.json
config: {
dist: 'dist', // dist path
reports: 'reports', // reports path
docs: 'docs' // docs path
},
uglify: { // uglify plugin to shorten js files, variables and remove comments
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: ['assets/js/models/*.js', 'assets/js/collections/*.js','assets/js/views/*.js'], // the js files to be uglified
dest: '<%= config.dist %>/js/<%= pkg.name %>.min.js' // the uglified output
}
},
copy: { // copy files & folders
assets: {
expand: true,
flatten: true,
src: [
//'assets/css/*.min.css',
//'assets/fonts/**/*',
'assets/img/**/*',
// Bower libs needed for oldIEs. The rest is concatenated via the bower_concat task.
//'libs/html5shiv/dist/html5shiv-printshiv.min.js',
//'libs/respondJs/dest/respond.min.js',
],
dest: '<%= config.dist %>/images' //destination
},
},
uncss: { // removed unused css (have problems with classes used in underscore templates)
dist: {
files: [
{ src: '*.html', dest: 'dist/css/compiled.min.css'}
]
},
options: {
compress:true
}
},
processhtml: {
dist: {
files: {
'dist/index.html': ['start.html']
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-uncss');
grunt.loadNpmTasks('grunt-processhtml');
// Default task(s).
grunt.registerTask('default', ['uglify','copy','uncss','processhtml']);
};