-
Notifications
You must be signed in to change notification settings - Fork 26
/
gulpfile.js
38 lines (35 loc) · 1.05 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
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
sassPaths = [
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src'
];
// Compile SASS → CSS
gulp.task('sass', function () {
return gulp.src(['assets/scss/*.scss', "!assets/scss/_*.scss"])
.pipe(plugins.sourcemaps.init())
.pipe(plugins.sass({
includePaths: sassPaths,
outputStyle : 'compressed' //options; expanded, nested, compact, compressed
})
.on('error', plugins.sass.logError))
.pipe(plugins.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('assets/css'));
});
// Process and minify JS
gulp.task('js', function () {
return gulp.src(['assets/js/*.js', "!*.min.js"])
.pipe(plugins.uglify())
.pipe(plugins.rename({
suffix: ".min"
}))
.pipe(gulp.dest('assets/js'));
});
// Automatically set up watchers when gulp is run
gulp.task('default', ['sass', 'js'], function () {
gulp.watch(['assets/scss/**/*.scss'], ['sass']);
gulp.watch(['assets/js/**/*.js'], ['js']);
});