-
Notifications
You must be signed in to change notification settings - Fork 10
/
gulpfile.js
32 lines (24 loc) · 933 Bytes
/
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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var gulpLoadPlugins = require('gulp-load-plugins');
var webpack = require('webpack-stream');
var $ = gulpLoadPlugins();
gulp.task('webpack', function() {
var is_production = true;
var uglify_options = { compress: { drop_console: is_production ? true : false } };
return gulp.src('./index.js')
.pipe( webpack( require('./webpack.config.js') ) )
.pipe($.if('*.js', $.sourcemaps.init()))
.pipe($.if('*.js', $.uglify( uglify_options )))
.pipe($.if('*.js', $.sourcemaps.write('.')))
.pipe(gulp.dest('dist/'));
});
gulp.task('scss', function() {
return gulp.src('./styles.scss/**/*.scss')
.pipe(sass({ outputStyle: 'compressed' }).on('error', sass.logError))
.pipe(gulp.dest('./css'));
});
gulp.task('scss:watch', function() {
gulp.watch('./styles.scss/**/*.scss', ['scss']);
});