var syntax = 'sass'; // Syntax: sass or scss;
var gulp = require('gulp'),
gutil = require('gulp-util' ),
sass = require('gulp-sass'),
browsersync = require('browser-sync').create(),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
cleancss = require('gulp-clean-css'),
rename = require('gulp-rename'),
autoprefixer = require('gulp-autoprefixer'),
notify = require("gulp-notify"),
rsync = require('gulp-rsync');
gulp.task('browser-sync', function() {
browsersync.init({
server: {
baseDir: 'app'
},
notify: false,
open: false,
// online: false, // Work Offline Without Internet Connection
// tunnel: true, tunnel: "projectname", // Demonstration page: http://projectname.localtunnel.me
})
});
gulp.task('styles', function() {
return gulp.src('app/'+syntax+'/**/*.'+syntax+'')
.pipe(sass({ outputStyle: 'expand' }).on("error", notify.onError()))
.pipe(rename({ suffix: '.min', prefix : '' }))
.pipe(autoprefixer(['last 15 versions']))
.pipe(cleancss( {level: { 1: { specialComments: 0 } } })) // Opt., comment out when debugging
.pipe(gulp.dest('app/css'))
.pipe(browsersync.reload( {stream: true} ));
});
gulp.task('js', function() {
return gulp.src([
'app/libs/jquery/dist/jquery.min.js',
'app/js/common.js', // Always at the end
])
.pipe(concat('scripts.min.js'))
// .pipe(uglify()) // Mifify js (opt.)
.pipe(gulp.dest('app/js'))
.pipe(browsersync.reload({ stream: true }))
});
gulp.task('rsync', function() {
return gulp.src('app/**')
.pipe(rsync({
root: 'app/',
hostname: 'username@yousite.com',
destination: 'yousite/public_html/',
// include: ['*.htaccess'], // Includes files to deploy
exclude: ['**/Thumbs.db', '**/*.DS_Store'], // Excludes files from deploy
recursive: true,
archive: true,
silent: false,
compress: true
}))
});
gulp.task('watch', ['styles', 'js', 'browser-sync'], function() {
gulp.watch('app/'+syntax+'/**/*.'+syntax+'', ['styles']);
gulp.watch(['libs/**/*.js', 'app/js/common.js'], ['js']);
gulp.watch('app/*.html', browsersync.reload);
});
gulp.task('default', ['watch']);
{
"name": "optimizedhtml",
"version": "4.1.0",
"description": "OptimizedHTML 4 - Start HTML Template",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "WebDesign Master",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.24.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^5.0.0",
"gulp-clean-css": "^3.9.3",
"gulp-concat": "^2.6.1",
"gulp-notify": "^3.2.0",
"gulp-rename": "^1.2.2",
"gulp-rsync": "0.0.8",
"gulp-sass": "^4.0.1",
"gulp-uglify": "^3.0.0",
"gulp-util": "^3.0.8"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<catalog>
<stores>
<store uid="111" name="444"/>
<store uid="222" name="555"/>
<store uid="333" name="666"/>
</stores>
</catalog>