-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
81 lines (79 loc) · 2.75 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
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
copy: {
jquery: {
nonull: true,
src: 'bower_components/jquery/dist/jquery.js',
dest: 'src/js/jquery.js'
},
bootstrap_less: {
expand: true,
cwd: 'bower_components/bootstrap/less/',
src: '**',
dest: 'src/less/bootstrap/'
},
bootstrap_js: {
expand: true,
cwd: 'bower_components/bootstrap/js/',
src: '**',
dest: 'src/js/bootstrap'
}
},
concat: {
plugins: {
src: [
'bower_components/jquery-file-upload/js/vendor/jquery.ui.widget.js',
'bower_components/jquery-file-upload/js/jquery.iframe-transport.js',
'bower_components/jquery-file-upload/js/jquery.fileupload.js',
'src/vendor/pdfjs/build/pdf.js',
'src/vendor/pdfjs/build/pdf.worker.js',
'src/vendor/pdfjs/build/generic/web/compatibility.js'
],
dest: 'src/js/plugins.js'
},
bootstrap: {
src: [
'src/js/bootstrap/transition.js',
'src/js/bootstrap/alert.js',
'src/js/bootstrap/button.js',
'src/js/bootstrap/carousel.js',
'src/js/bootstrap/collapse.js',
'src/js/bootstrap/dropdown.js',
'src/js/bootstrap/modal.js',
'src/js/bootstrap/tooltip.js',
'src/js/bootstrap/popover.js',
'src/js/bootstrap/scrollspy.js',
'src/js/bootstrap/tab.js',
'src/js/bootstrap/affix.js'
],
dest: 'static/js/main.js'
}
},
uglify: {
plugins: {
files: {
'static/js/plugins.js': ['src/js/plugins.js',]
}
}
},
less: {
build: {
options: {
compress: false,
yuicompress: true,
optimization: 2
},
files: {
// target.css file: source.less file
'static/css/main.css': 'src/less/_main.less'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['copy', 'concat', 'less']);
};