Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var gulp = require('gulp'),
- browserSync = require('browser-sync'),
- header = require('gulp-header'),
- cssnano = require('gulp-cssnano'),
- package = require('./package.json');
- var banner = [
- '/*!\n' +
- ' * <%= package.name %>\n' +
- ' * <%= package.title %>\n' +
- ' * <%= package.url %>\n' +
- ' * @author <%= package.author %>\n' +
- ' * @version <%= package.version %>\n' +
- ' * Copyright ' + new Date().getFullYear() + '. <%= package.license %> licensed.\n' +
- ' */',
- '\n'
- ].join('');
- gulp.task('css', function () {
- return gulp.src('src/scss/style.scss')
- .pipe(header(banner, { package : package }))
- .pipe(gulp.dest('app/assets/css'))
- .pipe(browserSync.reload({stream:true}));
- });
- gulp.task('js',function(){
- gulp.src('src/js/scripts.js')
- .pipe(header(banner, { package : package }))
- .pipe(gulp.dest('app/assets/js'))
- .pipe(browserSync.reload({stream:true, once: true}));
- });
- gulp.task('browser-sync', function() {
- browserSync.init(null, {
- server: { baseDir: "app" }
- });
- });
- gulp.task('bs-reload', function () {
- browserSync.reload();
- });
- gulp.task('default', ['css', 'js', 'browser-sync'], function () {
- gulp.watch("src/scss/**/*.scss", ['css']);
- gulp.watch("src/js/*.js", ['js']);
- gulp.watch("app/*.html", ['bs-reload']);
- });
Add Comment
Please, Sign In to add comment