-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (46 loc) · 1.34 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
var gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
changed = require('gulp-changed'),
header = require('gulp-header'),
notify = require('gulp-notify'),
plumber = require('gulp-plumber'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
pkg = require('./package.json');
var devInfo =
[
'',
'/*!',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @author <%= pkg.author %>',
' * @contributors <%= pkg.contributors %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.url %>',
' * @license <%= pkg.license %>',
' */',
'',
''
].join('\n');
var dist = './dist',
scss = [ './source/*.scss', './source/*/*.scss', './source/*/*/*.scss' ];
gulp.task('styles', function ()
{
return gulp.src(scss)
.pipe(plumber())
.pipe(changed(dist))
.pipe(header(devInfo, { pkg: pkg }))
.pipe(sourcemaps.init())
.pipe(sass({ precision: 4, outputStyle: 'compressed' }))
.pipe(autoprefixer(
{
browsers: ['last 3 versions'],
cascade: false
}))
.pipe(sourcemaps.write('../map'))
.pipe(gulp.dest(dist))
.pipe(notify({ message: 'first: Built', onLast: true }));
});
gulp.task('default', ['styles'], function ()
{
gulp.watch(scss, ['styles']);
});