-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (48 loc) · 1.81 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
var gulp = require('gulp');
var autoprefixer = require('gulp-autoprefixer');
var cleanCSS = require('gulp-clean-css');
var csso = require('gulp-csso');
var minify = require('gulp-minify');
var inject = require('gulp-inject');
/* Add X-browser compatibility prefixes to all *.css */
// gulp.task('default', () =>
// gulp.src('./assets/css/style.css')
// .pipe(autoprefixer({
// browsers: ['last 2 versions'],
// cascade: false
// }))
// .pipe(gulpCopy('.assets/prod/css/'))
// .pipe(gulp.dest('./assets/prod/css/'))
// );
// /* Minify css */
// gulp.task('compress-css', function () {
// return gulp.src('./assets/raw/css/style.css')
// .pipe(csso())
// .pipe(gulp.dest('./assets/css/'));
// });
/* Minify js */
gulp.task('default', function() {
gulp.src('./assets/js/*.js')
.pipe(minify({
ext:{
src:'-raw.js',
min:'.js'
}
}))
.pipe(gulp.dest('./assets/js'))
});
// /* Inject assets */
// gulp.task('inject-css', function () {
// var target = gulp.src('./application/views/templates/header.php');
// // It's not necessary to read the files (will speed up things), we're only after their paths:
// var sources = gulp.src(['./assets/css/*.css'], {read: false});
// return target.pipe(inject(sources))
// .pipe(gulp.dest('./application/views/templates/'));
// });
// gulp.task('inject-js', function () {
// var target = gulp.src('./application/views/templates/footer.php');
// // It's not necessary to read the files (will speed up things), we're only after their paths:
// var sources = gulp.src(['./assets/js/*.js'], {read: false});
// return target.pipe(inject(sources))
// .pipe(gulp.dest('./application/views/templates/'));
// });