-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
65 lines (59 loc) · 2.19 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
'use strict';
var gulp = require('gulp');
var watch = require('gulp-watch');
var concat = require('gulp-concat');
var sass = require('gulp-sass')(require('sass'));
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var autoprefixer = require('gulp-autoprefixer');
var lec = require('gulp-line-ending-corrector');
var paths = {
scss: [ 'assets/scss/**/*.scss', 'assets/css/' ],
// scss_back: [ 'css/scss-admin/**/*.scss', 'css/' ],
// js: ['js/beflex/**/*.js', 'js/']
};
/** SCSS */
gulp.task( 'build_scss', function() {
return gulp.src( paths.scss[0] )
.pipe( sass( { 'outputStyle': 'expanded' } ).on( 'error', sass.logError ) )
.pipe( autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}) )
.pipe(lec({verbose:true, eolc: 'CRLF', encoding:'utf8'}))
.pipe( gulp.dest( paths.scss[1] ) )
.pipe( sass({outputStyle: 'compressed'}).on( 'error', sass.logError ) )
.pipe( rename( './style.min.css' ) )
.pipe(lec({verbose:true, eolc: 'CRLF', encoding:'utf8'}))
.pipe( gulp.dest( paths.scss[1] ) );
});
/** Scss Backadmin */
// gulp.task( 'build_scss_back', function() {
// return gulp.src( paths.scss_back[0] )
// .pipe( sass( { 'outputStyle': 'expanded' } ).on( 'error', sass.logError ) )
// .pipe( autoprefixer({
// browsers: ['last 2 versions'],
// cascade: false
// }) )
// .pipe(lec({verbose:true, eolc: 'CRLF', encoding:'utf8'}))
// .pipe( gulp.dest( paths.scss_back[1] ) )
// .pipe( sass({outputStyle: 'compressed'}).on( 'error', sass.logError ) )
// .pipe( rename( './style-admin.min.css' ) )
// .pipe(lec({verbose:true, eolc: 'CRLF', encoding:'utf8'}))
// .pipe( gulp.dest( paths.scss_back[1] ) );
// });
/** JS */
// gulp.task( 'build_js', function() {
// return gulp.src( paths.js[0] )
// .pipe( concat( 'main.js' ) )
// .pipe( gulp.dest( paths.js[1] ) )
// .pipe( rename( 'main.min.js' ) )
// .pipe( uglify() )
// .pipe( gulp.dest( paths.js[1] ) )
// });
/** Watch */
gulp.task( 'default', function() {
gulp.watch( paths.scss[0], gulp.series('build_scss') );
// gulp.watch( paths.scss_back[0], gulp.series('build_scss_back') );
// gulp.watch( paths.js[0], gulp.series('build_js') );
});