-
Notifications
You must be signed in to change notification settings - Fork 41
/
config.js
executable file
·174 lines (163 loc) · 4.55 KB
/
config.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/**
* Gulp configuration file
*/
// basic paths
var dir_bower = './bower_components', // folder with Bower packages
dir_src = './src', // folder for non-public source scripts, stylesheets, pre-processed images, etc.
dir_asset = './assets', // folder for public assets
dir_dist = dir_asset + '/dist', // destination for post-processed scripts, stylesheets and images
dir_theme = dir_src + '/theme'; // default folder for theme files
module.exports = {
// Task: clean up destination folder
// Plugin: del (https://github.com/sindresorhus/del)
clean: {
src: [
dir_dist + "**/*",
"!" + dir_dist + "/index.html"
]
},
// Task: copy required files & folders to destination folder
copy: {
src: {
// Font files from Bower packages
fonts: [
dir_bower + '/bootstrap/dist/fonts/**',
dir_bower + '/font-awesome/fonts/**',
dir_bower + '/ionicons/fonts/**'
],
// Files (JS / CSS / etc.) directly copy to destination folder
files: [
]
},
dest: {
fonts: dir_dist + '/fonts',
files: dir_dist
}
},
// Task: concat and minify CSS files
// Plugin: gulp-clean-css (https://github.com/scniro/gulp-clean-css)
cssmin: {
src: {
// Frontend Website - 3rd party libraries
frontend_lib: [
dir_bower + '/bootstrap/dist/css/bootstrap.min.css',
dir_bower + '/font-awesome/css/font-awesome.min.css',
],
// Admin Panel - AdminLTE theme
adminlte: [
dir_bower + '/admin-lte/bootstrap/css/bootstrap.min.css',
dir_bower + '/admin-lte/dist/css/AdminLTE.min.css',
dir_bower + '/admin-lte/dist/css/skins/_all-skins.min.css',
],
// Admin Panel - 3rd party libraries
admin_lib: [
dir_bower + '/font-awesome/css/font-awesome.min.css',
dir_bower + '/ionicons/css/ionicons.min.css',
dir_bower + '/spectrum/spectrum.css'
]
},
dest: {
frontend: dir_dist + '/frontend',
admin: dir_dist + '/admin'
},
dest_file: {
frontend_lib: 'lib.min.css',
adminlte: 'adminlte.min.css',
admin_lib: 'lib.min.css'
},
options: {
advanced: true, // set "false" for faster operation, but slightly larger output files
keepSpecialComments: 0
}
},
// Task: compile SASS files (and concat with CSS files)
// Plugin: gulp-sass (https://github.com/dlmanning/gulp-sass)
sass: {
src: {
// Frontend Website
frontend: [
// Main SASS file
dir_src + '/sass/frontend.scss',
// Bootstrap examples (http://getbootstrap.com/getting-started/#examples)
// Comment this to remove preset styles
dir_src + '/css/bootstrap-examples/sticky-footer-navbar.css',
// Custom CSS file
dir_src + '/css/frontend.css'
],
// Admin Panel
admin: [
// Main SASS file
dir_src + '/sass/admin.scss',
// Custom CSS file
dir_src + '/css/admin.css'
]
},
dest: {
frontend: dir_dist + '/frontend',
admin: dir_dist + '/admin'
},
dest_file: {
frontend: 'app.min.css',
admin: 'app.min.css'
},
options: {
outputStyle: 'compressed'
}
},
// Task: concat and minify (uglify) JS files
// Plugin: gulp-uglify (https://github.com/terinjokes/gulp-uglify)
uglify: {
src: {
// Frontend Website - 3rd party libraries
frontend_lib: [
dir_bower + '/jquery/dist/jquery.min.js',
dir_bower + '/bootstrap/dist/js/bootstrap.min.js',
],
// Frontend Website - custom scripts
frontend: [
dir_src + '/js/frontend.js'
],
// Admin Panel - AdminLTE theme
adminlte: [
// use jQuery 1.x for compatibility with Grocery CRUD
dir_bower + '/jquery-legacy/dist/jquery.min.js',
dir_bower + '/jquery-migrate/jquery-migrate.min.js',
dir_bower + '/admin-lte/bootstrap/js/bootstrap.min.js',
dir_bower + '/admin-lte/plugins/fastclick/fastclick.js',
dir_bower + '/admin-lte/plugins/slimScroll/jquery.slimscroll.min.js',
dir_bower + '/admin-lte/dist/js/app.min.js',
// include other plugins below when necessary
],
// Admin Panel - 3rd party libraries
admin_lib: [
dir_bower + '/Sortable/Sortable.min.js',
dir_bower + '/spectrum/spectrum.js',
],
// Admin Panel - custom scripts
admin: [
dir_src + '/js/admin.js'
]
},
dest: {
frontend: dir_dist + '/frontend',
admin: dir_dist + '/admin'
},
dest_file: {
frontend_lib: 'lib.min.js',
frontend: 'app.min.js',
adminlte: 'adminlte.min.js',
admin_lib: 'lib.min.js',
admin: 'app.min.js',
},
options: {
}
},
// Tasks: optimize images
// Plugin: gulp-imagemin (https://github.com/sindresorhus/gulp-imagemin)
imagemin: {
src: dir_src + "/images/**/*.{png,jpg,gif,svg}",
dest: dir_dist + "/images",
options: {
}
}
};