-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
58 lines (55 loc) · 1.6 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
module.exports = function(grunt){
grunt.initConfig({
bower: {
install: {
//just run 'grunt bower:install' and you'll see files from your Bower packages in lib directory
},
options: {
targetDir: "lib"
}
},
copy: {
main: {
files: [
{
src: 'bower_components/codemirror/mode/javascript/javascript.js',
dest: 'lib/codemirror/mode/javascript/javascript.js'
}
],
options: {
process: function (content, srcpath) {
return content.replace(/..\/..\/lib\/codemirror/g,"../../codemirror.min");
}
}
}
},
uglify: {
min: {
files: grunt.file.expandMapping(['lib/**/*.js'], 'js/', {
rename: function(destBase, destPath) {
return destBase+destPath.replace('.js', '.min.js');
}
})
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'css/bootstrap.min.css': ['lib/bootstrap/bootstrap.css'],
'js/lib/codemirror/codemirror.min.css': ['lib/codemirror/codemirror.css'],
'js/lib/jquery-growl/jquery.growl.min.css': ['lib/jquery-growl/jquery.growl.css']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('build', ['bower:install', 'copy:main']);
grunt.registerTask('minify', ['uglify:min', 'cssmin:target']);
};