forked from ColorlibHQ/AdminLTE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
116 lines (112 loc) · 4.7 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
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
watch: {
// If any .less file changes in directory "build/less/" run the "less"-task.
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"],
tasks: ["less", "uglify"]
},
// "less"-task configuration
// This task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
less: {
// Development not compressed
development: {
options: {
// Whether to compress or not
compress: false
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.css": "build/less/AdminLTE.less",
//Non minified skin files
"dist/css/skins/skin-blue.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.css": "build/less/skins/_all-skins.less"
}
},
// Production compresses version
production: {
options: {
// Whether to compress or not
compress: true
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less",
// Skins minified
"dist/css/skins/skin-blue.min.css": "build/less/skins/skin-blue.less",
"dist/css/skins/skin-black.min.css": "build/less/skins/skin-black.less",
"dist/css/skins/skin-yellow.min.css": "build/less/skins/skin-yellow.less",
"dist/css/skins/skin-green.min.css": "build/less/skins/skin-green.less",
"dist/css/skins/skin-red.min.css": "build/less/skins/skin-red.less",
"dist/css/skins/skin-purple.min.css": "build/less/skins/skin-purple.less",
"dist/css/skins/skin-blue-light.min.css": "build/less/skins/skin-blue-light.less",
"dist/css/skins/skin-black-light.min.css": "build/less/skins/skin-black-light.less",
"dist/css/skins/skin-yellow-light.min.css": "build/less/skins/skin-yellow-light.less",
"dist/css/skins/skin-green-light.min.css": "build/less/skins/skin-green-light.less",
"dist/css/skins/skin-red-light.min.css": "build/less/skins/skin-red-light.less",
"dist/css/skins/skin-purple-light.min.css": "build/less/skins/skin-purple-light.less",
"dist/css/skins/_all-skins.min.css": "build/less/skins/_all-skins.less"
}
}
},
// Uglify task info. Compress the js files.
uglify: {
options: {
mangle: true,
preserveComments: 'some'
},
my_target: {
files: {
'dist/js/app.min.js': ['dist/js/app.js']
}
}
},
// Build the documentation files
includes: {
build: {
src: ['*.html'], // Source files
dest: 'documentation/', // Destination directory
flatten: true,
cwd: 'documentation/build',
options: {
silent: true,
includePath: 'documentation/build/include'
}
}
},
cssjanus: {
build: {
files: {
'dist/css/AdminLTE-rtl.css': 'dist/css/AdminLTE.css',
'dist/css/AdminLTE-rtl.min.css': 'dist/css/AdminLTE.min.css',
'bootstrap/css/bootstrap-rtl.css': 'bootstrap/css/bootstrap.css',
'bootstrap/css/bootstrap-rtl.min.css': 'bootstrap/css/bootstrap.min.css'
}
}
}
});
// Load all grunt tasks
// LESS Compiler
grunt.loadNpmTasks('grunt-contrib-less');
// Watch File Changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Compress JS Files
grunt.loadNpmTasks('grunt-contrib-uglify');
// Include Files Within HTML
grunt.loadNpmTasks('grunt-includes');
// Convert CSS to RTL
grunt.loadNpmTasks('grunt-cssjanus');
// The default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};