gulp

How do I get gulp + browsersync to work an apache vhost?

ぐ巨炮叔叔 提交于 2020-01-01 09:43:50
问题 I'd like to add gulp, sass and browsersync to my toolkit. I'm now running gulp with a sass and browsersync task configured. I'm skinning a php app running from a vhost on my local apache server. I'm attempting to run browsersync from a watch task, using the browsersync's proxy option to use my vhost. Currently, when I run the watch no server can be found on port 3000. If I navigate to 'localhost:3000' I get chromes 'no web page found' message. If I navigate to port 3001 I can access

gulp-order node module with merged streams

99封情书 提交于 2020-01-01 09:43:13
问题 I'm using the gulp-order module along with the event-streams module and gulp-concat to concatenate javascript files into a single dest file. The gulp-order plugin has worked great for me in other projects where I wanted to concatenate files from the stream in a distinct order. For some reason in this project it is not working properly, and the files in the public/angular/config directory are dispersed amongst the files I specify to concatenate last in the public/js directory. I think this may

Gulp using gulp-jade with gulp-data

允我心安 提交于 2020-01-01 07:22:08
问题 I'm trying to use gulp-data with gulp-jade in my workflow but I'm getting an error related to the gulp-data plugin. Here is my gulpfile.js var gulp = require('gulp'), plumber = require('gulp-plumber'), browserSync = require('browser-sync'), jade = require('gulp-jade'), data = require('gulp-data'), path = require('path'), sass = require('gulp-ruby-sass'), prefix = require('gulp-autoprefixer'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), process = require('child_process');

Gulp: only compile changed files AND compile parents when imported SCSS file is edited

南楼画角 提交于 2020-01-01 06:56:09
问题 At work we used to use Ruby to compile SCSS. I had the Ruby compiler set up as a file watcher in PhpStorm, and when I edited a partial imported by another file, the CSS file corresponding to the ancestor file was updated without any fuss. I want to get Gulp and Libsass to work the same way. Most solutions I've seen just compile all the SCSS files in a project when a single one changes, but our projects have way too much SCSS for that to be an acceptable solution. gulp-cached seemed like a

Improve PNG optimization Gulp task

夙愿已清 提交于 2020-01-01 05:18:13
问题 This is source PNG with transparency: http://i.imgur.com/7m0zIBp.png (13.3kB) optimized using compresspng.com: http://i.imgur.com/DHUiLuO.png (5.4kB) optimized using tinypng.com: http://i.imgur.com/rEE2hzg.png (5.6kB) optimized with gulp-imagemin+imagemin-pngquant: http://i.imgur.com/OTqI6lK.png (6.6kB) As you can see online tools are better than Gulp. Is there a way to improve PNG optimization with Gulp? Just in case, here's my gulp task: gulp.task('images', function() { return gulp.src(

Gulp-watch is not picking up new files

安稳与你 提交于 2020-01-01 04:46:07
问题 I'm trying to run a task whenever a file get's changed, delete or a new file is added. The first two work, however: when a new file is added it's not being picked up. I installed the package gulp-watch and I have this task: var gulp = require('gulp'), watch = require('gulp-watch'); gulp.task('watch', function() { watch( ['./src/Scripts/**/*.js'], function(ev, cb) { console.log('test'); cb(); }); }); 回答1: That was a weird problem. Removing ./ from glob fixes it. var gulp = require('gulp'); var

How can I debug Gulp tasks using Node Tools for Visual Studio?

那年仲夏 提交于 2020-01-01 04:22:31
问题 I recently installed NodeJS Tools for Visual Studio which touts support for Node environments in VS. Notably, it has the ability to set debug breakpoints from the IDE. It's unclear to me if it is possible to set breakpoints when debugging Gulp tasks. The Task Runner has the ability to detect the Gulp task and output console.log statements to a window, but I haven't found a better means of debugging. I found this post from a while back: How can I debug gulpfile.js when running it with Visual

How to handle 'code generator has deoptimised styling' message from gulp-babel

这一生的挚爱 提交于 2020-01-01 03:12:07
问题 I've just employed gulp-babel to my gulp file with the following var babel = require('gulp-babel'); return gulp.src(files.concat.js.myModule) .pipe(babel()) .pipe(concat('myModule.js')) .pipe(gulp.dest('path/to/js')); ...and I get the following Note about deoptimising the styling in my gulp output: NOTE: The code generator has deoptimised the styling ... as it exceeds the max of "100KB" Is this a problem? Should I be handling this is some way? 回答1: Turns out the compact option is set to auto

Make browserify modules external with Gulp

ぐ巨炮叔叔 提交于 2020-01-01 03:06:06
问题 I have a library lib.js that I want to create from lib/a.js and lib/b.js and to be able to use it from a script client.js using var a = require('lib/a.js'); and that it works when I just include the compiled lib.js library before client.js (therefore, lib.js has to declare a require function that knows about lib/a.js ) I guess I have to use external and alias but I am not sure what is the proper way to do it Also, is it possible to have a Gulp file that creates all the alias automatically for

How to configure port in browser-sync

拜拜、爱过 提交于 2020-01-01 02:28:31
问题 I have a gulp task running with browser-sync ,by default its running on port 3000 of node.js server.I want to change the default port to any other port like 3010. var gulp = require('gulp'), connect = require('gulp-connect'), browserSync = require('browser-sync'); gulp.task('serve', [], function() { browserSync( { server: "../ProviderPortal" }); }); /*** 8. GULP TASKS **********/ gulp.task('default', ['serve']); I am using: browser-sync version-2.6.1 I tried configuring the gulp task like: