-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
177 lines (142 loc) · 5.88 KB
/
gulpfile.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
175
176
177
/* @preserve
*
* Author: Jaume Sala
* Website: jaumesala.net
*
*/
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/
/*
|--------------------------------------------------------------------------
| Global variables
|--------------------------------------------------------------------------
*/
var publicPath = "public";
var vendorPath = 'vendor/';
var bowerPath = vendorPath + 'bower_components/';
var bowerRelative = '../../../' + bowerPath;
var nodePath = 'node_modules/';
var nodeRelative = '../../../' + nodePath;
var min = elixir.config.production ? '.min' : '';
elixir.config.publicPath = publicPath;
elixir.config.css.autoprefix.options.browsers = ['last 2 versions', 'ie 8', 'ie 9'];
/*
|--------------------------------------------------------------------------
| Bower components array (plugins.js)
|--------------------------------------------------------------------------
*/
var components = [
bowerRelative + 'bootstrap-sass/assets/javascripts/bootstrap.js',
bowerRelative + 'underscore/underscore.js',
bowerRelative + 'chroma-js/chroma.js',
bowerRelative + 'AdminLTE/plugins/iCheck/icheck.js',
bowerRelative + 'AdminLTE/plugins/slimScroll/jquery.slimscroll.js',
bowerRelative + 'AdminLTE/plugins/select2/select2.full.js',
bowerRelative + 'AdminLTE/plugins/bootstrap-slider/bootstrap-slider.js',
bowerRelative + 'AdminLTE/plugins/slimScroll/jquery.slimscroll.js',
bowerRelative + 'AdminLTE/plugins/colorpicker/bootstrap-colorpicker.js',
bowerRelative + 'AdminLTE/dist/js/app.js',
];
var componentsPublic = [
bowerRelative + 'bootstrap-sass/assets/javascripts/bootstrap.js',
'admin/components/mapView.js',
bowerRelative + 'underscore/underscore.js',
bowerRelative + 'chroma-js/chroma.js',
];
/*
|--------------------------------------------------------------------------
| Copy array
|--------------------------------------------------------------------------
*/
var copyToPublic = [
// JQuery
[ bowerPath + 'jquery/jquery.js',
publicPath + '/' + elixir.config.js.outputFolder +'/vendor/jquery.js'],
[ bowerPath + 'jquery/jquery.min.js',
publicPath + '/' + elixir.config.js.outputFolder +'/vendor/jquery.min.js'],
// JQuery UI
[ bowerPath + 'jquery-ui/jquery-ui.js',
publicPath + '/' + elixir.config.js.outputFolder +'/vendor/jquery-ui.js'],
[ bowerPath + 'jquery-ui/jquery-ui.min.js',
publicPath + '/' + elixir.config.js.outputFolder +'/vendor/jquery-ui.min.js'],
// Modernizr
[ elixir.config.assetsPath + '/vendor/modernizr/modernizr-2.8.3.min.js',
publicPath + '/' + elixir.config.js.outputFolder + '/vendor/modernizr-2.8.3.min.js'],
// Bootstrap fonts
[ bowerPath + 'bootstrap-sass/assets/fonts/bootstrap',
elixir.config.publicPath + '/fonts/bootstrap'],
// Font-awesome fonts
[ bowerPath + 'font-awesome/fonts',
elixir.config.publicPath + '/fonts/font-awesome'],
// Project fonts
[ elixir.config.assetsPath + '/fonts',
elixir.config.publicPath + '/fonts'],
// Plugin iCheck images
[ bowerPath + 'AdminLTE/plugins/iCheck/square/blue.png',
elixir.config.publicPath + '/img/admin/plugins/iCheck/blue.png'],
[ bowerPath + 'AdminLTE/plugins/iCheck/square/[email protected]',
elixir.config.publicPath + '/img/admin/plugins/iCheck/[email protected]'],
// Plugin colorpicker
[ bowerPath + 'AdminLTE/plugins/colorpicker/img',
elixir.config.publicPath + '/img/admin/plugins/colorpicker']
];
/*
|--------------------------------------------------------------------------
| Main default task
|--------------------------------------------------------------------------
*/
elixir(function(mix) {
mix
/*
|--------------------------------------------------------------------------
| Admin files
|--------------------------------------------------------------------------
*/
// admin/app.scss
.sass('admin/app.scss', publicPath + '/' + elixir.config.css.outputFolder + '/admin/app' + min + '.css')
// admin/app/app.js
.scriptsIn(
elixir.config.assetsPath + '/js/admin',
publicPath + '/' + elixir.config.js.outputFolder + '/admin/app' + min + '.js'
)
//plugins.js
.scripts(
components,
publicPath + '/' + elixir.config.js.outputFolder + '/admin/plugins' + min + '.js',
elixir.config.assetsPath + '/js'
)
/*
|--------------------------------------------------------------------------
| Public files
|--------------------------------------------------------------------------
*/
// public/app.scss
.sass('public/app.scss', publicPath + '/' + elixir.config.css.outputFolder + '/public/app' + min + '.css')
// public/app/app.js
.scriptsIn(
elixir.config.assetsPath + '/js/public',
publicPath + '/' + elixir.config.js.outputFolder + '/public/app' + min + '.js'
)
//plugins.js
.scripts(
componentsPublic,
publicPath + '/' + elixir.config.js.outputFolder + '/public/plugins' + min + '.js',
elixir.config.assetsPath + '/js'
)
// copy files
for (var i = 0, len = copyToPublic.length; i < len; i++) {
mix.copy(
copyToPublic[i][0],
copyToPublic[i][1]
);
}
});