-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
139 lines (135 loc) · 4.56 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
main: {
src: [
'bower_components/jquery.easing/js/jquery.easing.js',
'bower_components/Placeholders/lib/utils.js',
'bower_components/Placeholders/lib/main.js',
'bower_components/classie/classie.js',
'js/plugins/*.js',
'js/<%= pkg.name %>.js'
],
dest: 'dist/js/<%= pkg.name %>.js',
}
},
uglify: {
main: {
src: 'dist/js/<%= pkg.name %>.js',
dest: 'dist/js/<%= pkg.name %>.min.js'
}
},
copy: {
main: {
src: ['*.html', 'mail/**', 'img/**', 'less/**', 'favicon*', 'robots.txt', 'sitemap.xml', '.htaccess'],
dest: 'dist/',
},
jquery: {
files: [{
expand: true,
cwd: 'bower_components/jquery/dist/',
src: [
'jquery.js',
'jquery.min.js'
],
dest: 'dist/js/'
}, ]
},
bootstrap: {
files: [{
expand: true,
cwd: 'bower_components/bootstrap/dist/',
src: [
'css/bootstrap.css',
'css/bootstrap.min.css',
'js/bootstrap.js',
'js/bootstrap.min.js'
],
dest: 'dist/'
}, ]
},
glyphicons: {
files: [{
expand: true,
cwd: 'bower_components/bootstrap/dist/',
src: [
'fonts/glyphicons-halflings-regular.eot',
'fonts/glyphicons-halflings-regular.svg',
'fonts/glyphicons-halflings-regular.ttf',
'fonts/glyphicons-halflings-regular.woff',
],
dest: 'dist/'
}, ]
},
},
less: {
expanded: {
options: {
paths: ["css"]
},
files: {
"dist/css/<%= pkg.name %>.css": "less/<%= pkg.name %>.less"
}
},
minified: {
options: {
paths: ["css"],
cleancss: true
},
files: {
"dist/css/<%= pkg.name %>.min.css": "less/<%= pkg.name %>.less"
}
}
},
banner: '/*!\n' +
' * <%= pkg.title %> v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
' * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
' */\n',
usebanner: {
dist: {
options: {
position: 'top',
banner: '<%= banner %>'
},
files: {
src: ['dist/css/<%= pkg.name %>.css', 'dist/css/<%= pkg.name %>.min.css', 'dist/js/<%= pkg.name %>.js', 'dist/js/<%= pkg.name %>.min.js']
}
}
},
watch: {
scripts: {
files: ['js/<%= pkg.name %>.js, js/plugins/*.js'],
tasks: ['concat', 'uglify'],
options: {
spawn: false,
},
},
copy: {
files: ['*.html', 'mail/**', 'img/**', 'less/**'],
tasks: ['copy'],
options: {
spawn: false,
}
},
less: {
files: ['less/*.less'],
tasks: ['less'],
options: {
spawn: false,
}
},
}
});
// Load the plugins.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['concat', 'uglify', 'copy', 'less', 'usebanner']);
};