Skip to content

Instantly share code, notes, and snippets.

@stephanie-walter
Created August 7, 2015 21:02
Show Gist options
  • Save stephanie-walter/e330e662dc9d62fc8185 to your computer and use it in GitHub Desktop.
Save stephanie-walter/e330e662dc9d62fc8185 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
// Load the packages
var autoprefixer = require('gulp-autoprefixer');
var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglifyjs');
var less = require('gulp-less');
var livereload = require('gulp-livereload');
gulp.task('styles', function () {
// Tells Gulp where to find my file
return gulp.src('app/styles/main.less')
// Will compile the SASS, The sourcemap=none is a fix
// to A problem that have Autoprefixer
.pipe(less())
// Will autoprefix the css
.pipe(autoprefixer())
.pipe(livereload())
// The final destination
.pipe(gulp.dest('app/styles'));
});
gulp.task('scripts', function () {
return gulp.src('app/scripts/scripts.js')
// The js files location
.pipe(uglify())
// Will minify the JS
.pipe(gulp.dest('app/dist/scripts/'));
// The final destination
});
gulp.task('watch', function () {
livereload.listen();
gulp.watch('app/styles/**/*.less', ['styles']);
gulp.watch('app/scripts/**/*.js', ['scripts']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment