-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gruntfile.js
66 lines (55 loc) · 2.4 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
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
//grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
concat: {
default: {
src: [
'./public/vendor/jquery/src/jquery.js',
'./public/vendor/bootstrap/dist/js/bootstrap.js'
],
dest: './src/app/www/js/bsjq.js',
}
},
less: {
default: {
options: {
compress: true, //minifying the result
},
files: {
"./src/app/www/css/frontend.css": "./src/assets/css/frontend.less"
}
}
},
uglify: {
options: {
mangle: false // Use if you want the names of your functions and variables unchanged
},
default: {
files: {
'./src/app/www/js/frontend.js': './src/app/www/js/frontend.js',
'./src/app/www/js/bootstrap.js': './src/app/www/js/bootstrap.js',
'./src/app/www/js/jquery.js': './src/app/www/js/jquery.js',
}
},
},
clean: ["src/app/www/css", "src/app/www/fonts", "src/app/www/js"],
copy: {
default: {
files: [
{ expand: true, src: "*", cwd: "src/assets/js/", dest: './src/app/www/js' },
{ expand: true, src: "*", cwd: "src/assets/fonts/", dest: './src/app/www/fonts' },
{ expand: true, src: "bootstrap.js", cwd: "public/vendor/bootstrap/dist/js/", dest: './src/app/www/js' },
{ expand: true, src: "jquery.js", cwd: "public/vendor/jquery/dist/", dest: './src/app/www/js' },
{ expand: true, src: "*", cwd: "public/vendor/font-awesome/fonts/", dest: './src/app/www/fonts' }
],
}
},
});
grunt.registerTask('all', 'Less Concat Uglify', ['less', 'concat', 'copy', 'uglify']);
grunt.registerTask('rebuild', 'Clean Less Concat Uglify', ['clean', 'less', 'concat', 'copy', 'uglify']);
}