-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
34 lines (30 loc) · 1.08 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
'use strict';
var gulp = require('gulp');
var sass = require('gulp-sass');
var rename = require('gulp-rename');
var path = require('path');
// Sass task
// Compile Our Sass from the "scss" directory
gulp.task('sass', function () {
return gulp.src(['./scss/*.scss', '!./scss/_*.scss'])
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(gulp.dest('./stylesheets'));
});
gulp.task('move-js-files', function () {
gulp.src([
'./node_modules/twitter-fetcher/js/twitterFetcher_min.js',
'./node_modules/fontfaceobserver/fontfaceobserver.js',
'./node_modules/magnific-popup/dist/jquery.magnific-popup.min.js'
], { base: './node_modules' })
.pipe(rename(function (file) {
// this removes extraneous directories on the file path
// eg. node_modules/package/file/path/filename.ext => package/filename.ext
if (file.dirname.split('/').length > 1){
file.dirname = path.dirname(file.dirname);
}
}))
.pipe(gulp.dest('./javascripts/vendor'))
});
gulp.task('default', ['sass'], function () {
gulp.watch(['scss/**/*.scss'], ['sass']);
});