-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
48 lines (38 loc) · 1.26 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
process.env.DISABLE_NOTIFIER = true;
var elixir = require('laravel-elixir');
require('laravel-elixir-rollup');
elixir.config.sourcemaps = false;
elixir.config.assetsPath = 'assets';
elixir.config.css.sass.pluginOptions.includePaths = ['node_modules'];
var production = elixir.config.production;
var banner =
'/**\n' +
' * Copyright (c) ' + new Date().getFullYear() + ' Du\n' +
' */';
elixir(function (mix) {
// Compile Sass
['demo', 'fileicons', 'filepicker'].forEach(function (file) {
if (!production) {
mix.sass(file + '.scss', 'assets/css/' + file + '.css');
}
});
// Compile Scripts
['', 'ui', 'drop', 'crop', 'camera'].forEach(function (plugin) {
var options = {
format: 'umd',
banner: banner,
// sourceMapFile: !production,
globals: {jquery: 'jQuery', filepicker: 'Filepicker'}
};
var src = 'src/';
var output = 'assets/js/filepicker';
if (plugin == '') {
options.moduleName = 'Filepicker';
} else {
src += 'plugins/' + plugin + '/';
output += '-' + plugin;
}
output += production ? '.min.js' : '.js';
mix.rollup(src + 'index.js', output, options);
});
});