After reinstalling node js gulp not working properly, but it worked excellent before. I tried a lot of ways and read a lot of issues on github and forums, but nothing... Tried delete globally installed packages and local installed. Reinstall node js, update node js, install [email protected] ... etc
Here my gulpfile:
gulp.task('js', function() {
return gulp.src([
'app/js/lightgallery.min.js',
'app/js/jquery.dotdotdot.min.js',
'app/js/common.js',
'app/js/jquery.magnific-popup.min.js'
])
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('app/js-output'))
.pipe(browserSync.reload({ stream: true }))
});
gulp.task('css', function() {
return gulp.src([
'app/css/header.css',
'app/css/bootstrap.css'
])
.pipe(concat('style.min.css'))
.pipe(autoprefixer(['last 15 versions']))
.pipe(cleancss( {level: { 1: { specialComments: 0 } } })) // Opt., comment out when debugging
.pipe(gulp.dest('app/css-output'))
.pipe(browserSync.stream())
});
Here package.json :
{
"name": "somename",
"version": "4.0.0",
"description": "somedescr",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "someone",
"license": "ISC",
"devDependencies": {
"browser-sync": "^2.26.3",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.0.0",
"gulp-clean-css": "^3.10.0",
"gulp-concat": "^2.6.1",
"gulp-notify": "^3.2.0",
"gulp-rename": "^1.4.0",
"gulp-rsync": "0.0.8",
"gulp-sass": "^4.0.1",
"gulp-uglify": "^3.0.1",
"gulp-util": "^3.0.8"
}
}
What i must to do to make it work? Or maybe is any alternative way simply concat & minify js, css, sass on local computer in one click?
I found alternative way to compress js and css using PHP scripts and run it on local server. Found very useful libraries written in PHP:
(https://github.com/mrclay/jsmin-php)(https://github.com/matthiasmullie/minify/) (12-13% less effective then 'gulp-uglify')And wrote simple master script to use them and make output. Maybe for someone this information can be helpful...