This file contains hidden or 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
{ | |
"name": "new project", | |
"version": "0.0.0", | |
"description": "new project", | |
"main": "gulpfile.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Loy Egor <[email protected]> (http://loyegor.com/)", | |
"license": "ISC", |
This file contains hidden or 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
/node_modules/ | |
/dist/ | |
*.7z | |
*.dmg | |
*.gz | |
*.iso | |
*.jar | |
*.rar | |
*.tar | |
*.zip |
This file contains hidden or 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
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
BrowserMatch ^Mozilla/4.0[678] no-gzip | |
BrowserMatch bMSIE !no-gzip !gzip-only-text/html | |
FileETag MTime Size | |
<ifmodule mod_expires.c> | |
<filesmatch ".(jpg|gif|png|css|js|swf|svg|woff|woff2|ttf|eot)$"> | |
ExpiresActive on | |
ExpiresDefault "access plus 7 day" | |
</filesmatch> |
This file contains hidden or 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
// install | |
// npm i gulp-concat gulp-clean-css gulp-uncss | |
var concat = require('gulp-concat'); | |
var cleanCSS = require('gulp-clean-css'); | |
var uncss = require('gulp-uncss'); | |
// concat, clean and remove unused css | |
gulp.task('compress:css', function() { | |
var cssreset = './app/css/reset.css'; | |
var cssplug = './app/css/plugins.css'; |
This file contains hidden or 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
// install | |
// npm i gulp-concat gulp-uglify | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
// concat and clean js | |
gulp.task('compress:js', function () { | |
var jsjq = './app/js/jquery.min.js'; | |
var jscore = './app/js/core.js'; | |
var jsplug = './app/js/plugins.js'; |
This file contains hidden or 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
// install | |
// cd node_modules \ | |
// chmod -R a+rwX . | |
// run without sudo | |
// npm i del gulp-responsive --unsafe-perm | |
var del = require('del'); | |
var responsive = require('gulp-responsive'); |
This file contains hidden or 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
ul>li*>a[href=$#.html]>{$#} |
This file contains hidden or 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
//&:after{ | |
.cfix() { | |
content: ""; | |
display: table; | |
clear: both; | |
} | |
//} |
This file contains hidden or 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
//install | |
//npm i gulp-inject [email protected] | |
var inject = require('gulp-inject'); | |
//inject html | |
gulp.task('inject:html', function() { | |
return gulp.src('./app/*.html') | |
.pipe(inject(gulp.src(['./app/template/*.html']), { | |
starttag: '<!-- inject:{{path}} -->', | |
relative: false, //if true inject:/app/template/menu.html, if false inject:template/menu.html |
This file contains hidden or 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
//install | |
//npm i gulp-if gulp-notify gulp-plumber gulp-util | |
var gulpif = require('gulp-if'); | |
var notify = require('gulp-notify'); | |
var plumber = require('gulp-plumber'); | |
var gutil = require('gulp-util'); | |
//report error | |
var reportError = function(error) { | |
var report = '\n'; |