Created
June 10, 2018 15:34
-
-
Save nishim/08d74ec7b5306badd63b6fe666e50222 to your computer and use it in GitHub Desktop.
gulp/ejs/scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const gulp = require('gulp') | |
const sass = require('gulp-sass') | |
const autoprefixer = require('gulp-autoprefixer') | |
const ejs = require('gulp-ejs') | |
const rename = require('gulp-rename') | |
const paths = { | |
styles: { | |
src: 'src/scss/**/*.scss', | |
dest: 'public/styles/' | |
}, | |
templates: { | |
src: 'src/ejs/**/*.ejs', | |
dest: 'public/' | |
} | |
} | |
const styles = () => { | |
return gulp.src(paths.styles.src) | |
.pipe(sass({outputStyle: 'compressed'})) | |
.pipe(autoprefixer()) | |
.pipe(gulp.dest(paths.styles.dest)) | |
} | |
const templates = () => { | |
return gulp.src(paths.templates.src) | |
.pipe(ejs()) | |
.pipe(rename({extname: '.html'})) | |
.pipe(gulp.dest(paths.templates.dest)) | |
} | |
const watch = () => { | |
gulp.watch(paths.styles.src, styles) | |
gulp.watch(paths.templates.src, templates) | |
} | |
exports.styles = styles | |
exports.templates = templates | |
exports.watch = watch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"devDependencies": { | |
"gulp": "^4.0.0", | |
"gulp-autoprefixer": "^5.0.0", | |
"gulp-ejs": "^3.1.3", | |
"gulp-rename": "^1.2.3", | |
"gulp-sass": "^4.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment