-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
61 lines (55 loc) · 1.51 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
/*
* Gulpfile
*/
var gulp = require('gulp'),
plumber = require('gulp-plumber'),
minifycss = require('gulp-minify-css'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
include = require('gulp-include'),
autoprefixer = require('gulp-autoprefixer'),
stylish = require('jshint-stylish'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
sass = require('gulp-sass'),
js_filename = './assets/js/dfp_interstitial_ad.js',
scss_filename = './assets/css/dfp_interstitial_ad.scss';
gulp.task('scss', function() {
return gulp.src(scss_filename)
.pipe(sass())
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(rename({
dirname: './assets/css/',
basename: 'dfp_interstitial_ad',
extname: '.css'
}))
.pipe(gulp.dest('./'))
.pipe(minifycss())
.pipe(rename({
dirname: './assets/css/',
suffix: '.min',
extname: '.css'
}))
.pipe(gulp.dest('./'));
});
// Lint Task
gulp.task('lint', function() {
return gulp.src(js_filename)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
// Uglify Registration Scripts
gulp.task('scripts', function() {
return gulp.src(js_filename)
.pipe(rename({
dirname: './assets/js/',
suffix: '.min',
extname: '.js'
}))
.pipe(uglify())
.pipe(gulp.dest('./'));
});
gulp.task('default', ['scss', 'lint', 'scripts'], function() {});