-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
77 lines (71 loc) · 1.89 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
var gulp = require('gulp'),
elixir = require('laravel-elixir'),
poststylus = require('poststylus'),
rupture = require('rupture'),
axis = require('axis'),
htmlmin = require('gulp-htmlmin'),
cssnano = require('gulp-cssnano');
require('laravel-elixir-stylus');
require('laravel-elixir-imagemin');
elixir.config.sourcemaps = true;
elixir.extend('compress', function() {
new elixir.Task('compress', function() {
return gulp.src('./storage/framework/views/*')
.pipe(htmlmin({
collapseWhitespace: true,
removeAttributeQuotes: true,
removeComments: true,
minifyJS: true,
}))
.pipe(gulp.dest('./storage/framework/views/'));
})
.watch('./resources/views/**/*.blade.php');
});
elixir.extend('cssnano', function() {
new elixir.Task('cssnano', function() {
return gulp.src('./public/css/*.css')
.pipe(cssnano({
safe:true,
autoprefixer: {add:true}
}))
.pipe(gulp.dest('./public/css/'));
})
.watch('./public/css/*.css');
});
elixir(function(mix) {
mix
.stylus('app.styl', null, {
compress: true,
use: [
axis(),
rupture(),
poststylus(['lost'])
]})
.stylus('admin.styl', null, {
compress: true,
use: [
axis(),
rupture(),
poststylus(['lost']),
autoprefixer()
]})
.version([
'css/app.css',
'css/admin.css'
])
.webpack([
'components/**/*.js',
'app.js'
])
.imagemin({
optimizationLevel: 3,
progressive: true,
interlaced: true
})
.browserSync({
proxy: 'cv.dev',
notify: false
})
.cssnano()
.compress();
});