-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
94 lines (85 loc) · 2.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
var gulp = require('gulp');
var path = require('path');
var plugins = require('gulp-load-plugins')({
pattern: ['*'],
rename: {
'merge-stream': 'merge',
'node-notifier': 'notifier',
'gulp-util': 'gutil',
}
});
/*
|--------------------------------------------------------------------------
| User settings
|--------------------------------------------------------------------------
|
| These settings can be modified by the user to his desires.
| All possible options, are listed here
*/
var settings = {
root: path.resolve('./'),
bower: 'bower_components',
webpack: 'webpack.config.js',
dest: 'public/',
scripts: {
watch: ['resources/assets/js/**/*.js', 'resources/assets/js/**/*.vue'],
// Compile source is in the webpack.config.js
},
less: {
watch: 'resources/assets/less/**/*.less',
compile: 'resources/assets/less/app.less',
},
sass: {
watch: 'resources/assets/sass/**/*.scss',
compile: 'resources/assets/sass/app.scss',
},
error: function (error) {
plugins.gutil.log(plugins.gutil.colors.red('ERROR', error));
new plugins.gutil.PluginError('ERROR', error, { showStack: true });
plugins.notifier.notify({
icon: 'node_modules/laravel-elixir/icons/fail.png',
title: 'Failed',
message: error,
});
}
};
/**
* Include task
* @param {string} task
* @return {Function}
*/
function task(task) {
return require(path.resolve(settings.bower + '/laravel-gulpfile/tasks/' + task))(gulp, plugins, settings);
}
/*
|--------------------------------------------------------------------------
| Project related tasks
|--------------------------------------------------------------------------
|
| Here we define the project related tasks. This includes compiling
| all our stylesheet files, wether it's SASS or LESS. The Webpack task
| is also defined here.
|
*/
gulp.task('compile:js', task('project/javascript.js'));
gulp.task('compile:less', task('project/less.js'));
gulp.task('compile:sass', task('project/sass.js'));
/*
|--------------------------------------------------------------------------
| Vendor related tasks
|--------------------------------------------------------------------------
|
| All the vendor tasks, use the mainBowerFiles plugin to
| search for the main files from bower components. It will concat all
| files to one single vendor file.
*/
gulp.task('vendor:js', task('vendor/javascript.js'));
gulp.task('vendor:css', task('vendor/styles.js'));
gulp.task('vendor:fonts', task('vendor/fonts.js'));
gulp.task('compile:vendor', ['vendor:js', 'vendor:css', 'vendor:fonts']);
gulp.task('watch', function () {
gulp.watch(settings.scripts.watch, ['compile:js']);
gulp.watch(settings.less.watch, ['compile:less']);
gulp.watch(settings.sass.watch, ['compile:sass']);
});
gulp.task('default', []);