This commit is contained in:
Brittany Chiang
2017-03-14 23:50:30 -04:00
parent 7e16ccdb46
commit 6cf1122d8e
6 changed files with 82 additions and 11 deletions

0
build/browsersync.js Normal file
View File

11
build/fonts.js Normal file
View File

@@ -0,0 +1,11 @@
const fontsPath = 'fonts/**/*';
const destPath = '_site/fonts';
module.exports = gulp => {
gulp.task('fonts', () => {
return gulp.src( fontsPath )
.pipe(gulp.dest( destPath ));
});
}

14
build/images.js Normal file
View File

@@ -0,0 +1,14 @@
const imagemin = require('gulp-imagemin');
const imgPath = 'img/**/*.+(png|jpg|gif|svg)';
const destPath = '_site/img';
module.exports = gulp => {
gulp.task('images', () => {
return gulp.src( imgPath )
.pipe(imagemin())
.pipe(gulp.dest( destPath ));
});
}

21
build/sass.js Normal file
View File

@@ -0,0 +1,21 @@
const sass = require('gulp-sass');
const prefix = require('gulp-autoprefixer');
const cleanCSS = require('gulp-clean-css');
const scssPath = '_scss/*.scss';
const destPath = '_site/css';
module.exports = gulp => {
gulp.task('sass', () => {
return gulp.src( scssPath )
.pipe(sass({
includePaths: ['scss'],
outputStyle: 'expanded'
}))
.pipe(prefix(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {cascade: true}))
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest( destPath ))
.pipe(gulp.dest('css'));
});
}

21
build/scripts.js Normal file
View File

@@ -0,0 +1,21 @@
const jshint = require('gulp-jshint');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const jsPath = '_scripts/*.js';
const destPath = '_site/js';
module.exports = gulp => {
gulp.task('scripts', () => {
return gulp.src( jsPath )
.pipe(jshint())
.pipe(babel({
presets: ['es2015']
}))
.pipe(uglify())
.pipe(gulp.dest( destPath ))
.pipe(gulp.dest( 'js' ));
});
}