Skip to content

Instantly share code, notes, and snippets.

@minhchu
Created September 23, 2016 15:53
Show Gist options
  • Save minhchu/1f4d2f50f4207db83411d5b3c3e50f2e to your computer and use it in GitHub Desktop.
Save minhchu/1f4d2f50f4207db83411d5b3c3e50f2e to your computer and use it in GitHub Desktop.
1. copy above files to your local folder
2. run `npm install`
3. run `npm -g gulp`
4. run `gulp sass`
5. run `gulp browser-sync`
var gulp = require('gulp');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var browserSync = require('browser-sync').create();
var config = {
sassFolder: 'scss/*.scss',
compiledCssFile: 'app.css',
cssFolder: 'css/'
}
gulp.task('sass', function() {
return gulp.src(config.sassFolder)
.pipe(sass().on('error', function(err) {
console.log(err.toString());
this.emit('end');
}))
.pipe(concat(config.compiledCssFile))
.pipe(gulp.dest(config.cssFolder));
});
gulp.task('browser-sync', function() {
browserSync.init({
server: {
baseDir: './'
}
});
});
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.16.0",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-sass": "^2.3.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment