gulp

Chrome can't open localhost:3000 with Gulp / BrowserSync

╄→гoц情女王★ 提交于 2019-12-01 06:51:00
For some reason, no matter what I try, Google Chrome never seems to be able to display http://localhost:3000 (or any other specified port number for that matter) when starting up a server with BrowserSync through Gulp. Navigating to the same URI in Firefox, shows that it works and that BrowserSync is connected . gulp.task('browser-sync', function() { browserSync.init({ server: { baseDir: './' }, port: 8080 }); }); I'm specifying port 8080 above as an alternative , but even using the default 3000 does not work in Chrome. Firefox seems to be able to work with either. I've been to: chrome://net

Gulp run alternative

。_饼干妹妹 提交于 2019-12-01 06:31:24
Everytime I run gulp, I see this message gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead. Example code: var watch = require('gulp-watch'); watch(['public/**/*.js','!public/**/*.min.js'],function(){ gulp.run('compressjs'); gulp.run('bs-reload'); }); How can I avoid using gulp.run() with gulp-watch? You shouldn't use run . Here is an alternative (to address that part of your answer), but not what you need to do: gulp .start('default') .once('task_stop', function(){ //do other stuff. }); If you really must fire an ad hoc task, but can literally use run.

Why do some Gulp streams “flow” by default, while others do not?

淺唱寂寞╮ 提交于 2019-12-01 06:08:06
问题 Consider these two gulp tasks: gulp.task('src', function(done) { gulp.src('docs/*') .on('end', function() { console.log('ending'); done(); }); }); gulp.task('dest', function(done) { gulp.src('docs/*') .pipe(gulp.dest('temp')) .on('end', function() { console.log('ending'); done(); }); }); Running gulp dest behaves as expected, outputting: [12:33:15] Using gulpfile ~/Projects/gulp-exit/gulpfile.js [12:33:15] Starting 'dest'... ending [12:33:15] Finished 'dest' after 13 ms However, running gulp

Automatic minification with nodeJS and Gulp task runner

老子叫甜甜 提交于 2019-12-01 05:36:16
I need some advices to improve automatic minification with node and gulp. The main objective is generate dynamically the minified files(for JS and LESS) in development mode and change automatically normal files(js and less) to minified files in production mode. The scenario contains: NodeJS and ExpressJS for routing and environment configuration Jade as template engine Gulp (task runner) This is my setup: GULP I'm using nodemon in order to lauch server.js wich starts my node server. In this gulp file i have some tasks (['watch']) for watch the changes on JS and LESS files and minify them in

How to debug gulpfile.js

南笙酒味 提交于 2019-12-01 05:18:52
What is the proper way to execute node-inspector in order to be able to debug gulpfile.js ? I've tried following (code in my gulpfile requires harmony and harmony-arrow-functions switches ): node-debug --nodejs --harmony --nodejs --harmony-arrow-functions /home/user/.npm-packages/bin/gulp default Node inspector was properly loaded however it was not possible to set breakpoint in gulpfile neither before nor after the file was loaded . It was also not possible to set breakpoints in gulp/index.js and orchestrator/index.js files. And it was not possible to "step into" following statement ( whole

Gulp run alternative

巧了我就是萌 提交于 2019-12-01 05:18:17
问题 Everytime I run gulp, I see this message gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead. Example code: var watch = require('gulp-watch'); watch(['public/**/*.js','!public/**/*.min.js'],function(){ gulp.run('compressjs'); gulp.run('bs-reload'); }); How can I avoid using gulp.run() with gulp-watch? 回答1: You shouldn't use run . Here is an alternative (to address that part of your answer), but not what you need to do: gulp .start('default') .once('task

Mock backend for Angular / Gulp app

两盒软妹~` 提交于 2019-12-01 04:51:33
I would like to mock the backend for quicker development by providing json response without reling on the real backend. The frontend app is an Angular app and we use Gulp as a development and build tool. E.g. have a specific api (.../custumers/123) return a static json result. Is there perhaps already a gulp tool for this? I recommend you check out https://github.com/wongatech/angular-multimocks . This allows you to create mock responses for your apis and allows you to switch between them in real time via the url in your app. We originally created it where I work to solve this exact issue and

JsHint - Hide This Message: ES5 option is now set per default

时间秒杀一切 提交于 2019-12-01 04:33:56
I'm using gulp-jshint, and the following error message is annoying: ES5 option is now set per default How can I remove it? It's just telling you that it is the default so you don't need to add it as an option. Look in the .jshintrc file and remove "es5": true . http://jslinterrors.com/es5-option-is-now-set-per-default For me it was line: "esversion" : 5, in .jshintrc . When I commented it problem disappeared. 来源: https://stackoverflow.com/questions/24212156/jshint-hide-this-message-es5-option-is-now-set-per-default

Gulp won't work in Jenkins

北城以北 提交于 2019-12-01 03:52:33
I've installed gulp globally (npm install gulp -g). But this isn't working I think. When I'm doing gulp test on my local program it works fine. But when I'm doing a gulp test on my (the same) program from github (on Jenkins), it gives the following error. It won't recognize the gulp command. Can someone help me? Thanks Error in Jenkins: [EnvInject] - Loading node environment variables. Building in workspace C:\Program Files (x86)\Jenkins\workspace\project1 > C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > C:

Electron app isn't finding CSS/JS included in package

杀马特。学长 韩版系。学妹 提交于 2019-12-01 03:51:15
问题 I have an HTML5 web app that I'm packaging up via Electron. I'm packaging via gulp-electron. The issue I'm having is that when the app is built and I run it, none of the CSS or JS files that are referenced in the index.html file are being loaded. I can see that the assets were included in the build, and are part of the .app bundle in the : myapp.app/Contents/Resources/app/ folder. Matter of fact, if I cd to that directory and run a node webserver (httpster), the app runs fine in that manner.