gulp

Browser-sync in mobile while local development

五迷三道 提交于 2019-12-03 08:34:32
How can I view my local dev website in my phone using gulp Browser-sync? I type localhost:3000 in my phones browser but it won't load When you run gulp in your terminal you should see : [BS] Access URLs: -------------------------------------- Local: http://localhost:3000 External: http://192.168.10.81:3000 -------------------------------------- UI: http://localhost:3001 UI External: http://192.168.10.81:3001 What it means is that your local URL is localhost at port 3000. For external users it will be the external IP [ not the UI one ]. To access from your phone you need to enter the External

Using SASS with Aurelia's Skeleton Navigation project

馋奶兔 提交于 2019-12-03 08:14:18
var gulp = require('gulp'); var sass = require('gulp-sass'); var runSequence = require('run-sequence'); var changed = require('gulp-changed'); var plumber = require('gulp-plumber'); var to5 = require('gulp-babel'); var sourcemaps = require('gulp-sourcemaps'); var paths = require('../paths'); var compilerOptions = require('../babel-options'); var assign = Object.assign || require('object.assign'); // transpiles changed es6 files to SystemJS format // the plumber() call prevents 'pipe breaking' caused // by errors from other gulp plugins // https://www.npmjs.com/package/gulp-plumber gulp.task(

Run Protractor with a single Gulp task

感情迁移 提交于 2019-12-03 07:59:49
Is there a way to run e2e tests using Protractor and Gulp in a single task? Right now, in order to run e2e tests, I have to open 3 separate shells and run the following: webdriver-manager update webdriver-manager start npm start (which runs the app server) protractor protractor.conf.js (in a separate window) There must be a simpler way of running these tests. Any thoughts? Here is a solution that can work var protractor = require("gulp-protractor").protractor; var spawn = require('child_process').spawn; //run webdriver method function runWebdriver(callback) { spawn('webdriver-manager', ['start

How to properly require modules from mocha.opts file

不羁的心 提交于 2019-12-03 07:36:58
问题 I'm using the expect.js library with my mocha unit tests. Currently, I'm requiring the library on the first line of each file, like this: var expect = require('expect.js'); describe('something', function () { it('should pass', function () { expect(true).to.be(true); // works }); }); If possible, I'd like to remove the boilerplate require code from the first line of each file , and have my unit tests magically know about expect . I thought I might be able to do this using the mocha.opts file:

gulp源码分析

試著忘記壹切 提交于 2019-12-03 07:29:55
一.整体结构分析 整体结构 通过在nodejs环境对源码的打印,我们最终得到的gulp实例行如下图。那么我们gulp实例上的属性和方法是如何生成的呢? Gulp { domain: null, _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, _registry: DefaultRegistry { _tasks: {} }, _settle: false, watch: [Function: bound ], task: [Function: bound task], series: [Function: bound series], parallel: [Function: bound parallel], registry: [Function: bound registry], tree: [Function: bound tree], lastRun: [Function: bound lastRun], src: [Function: bound src], dest: [Function: bound dest], symlink: [Function: bound symlink] } (1)类的实现 源码index.js分为三个部分

Live reload for electron application

痞子三分冷 提交于 2019-12-03 07:26:17
问题 I want to use a combination of VScode + Gulp + Electron to build an application. A nice feature of the development workflow would be to add an live reload task to my Gulp watch task, to reload the Electron application on every change. Any Idea how to achieve this? Your help is highly appreciated. 回答1: I was able to achieve this with the gulp-livereload plugin. Here is the code to livereload CSS ONLY. It's the same for everything else though. var gulp = require ('gulp'), run = require('gulp

Gulp Watch and Nodemon conflict

拥有回忆 提交于 2019-12-03 07:22:48
问题 Short of it: started using Gulp recently (convert from Grunt), and am trying to use both Gulp's default watch task (not gulp-watch from npm) for SASS/JS/HTML and gulp-nodemon (from npm) to restart an Express server upon changes. When running just gulp watch , it works fine; and when running gulp server (for nodemon) that works fine. However, using both together (shown below in the configuration of the default task), the watch stuff isn't working. The task is running, and on the CLI gulp shows

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

我是研究僧i 提交于 2019-12-03 07:15:55
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? Turns out the compact option is set to auto by default which removes "superfluous whitespace characters and line terminators [...] on input sizes >100KB

Make browserify modules external with Gulp

岁酱吖の 提交于 2019-12-03 06:33:48
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 the folders in my library? eg. creates an alias for all the files in the lib/ dir? Here are a couple

How to configure port in browser-sync

99封情书 提交于 2019-12-03 05:57:07
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: gulp.task('serve', [], function() { browserSync( { ui: { port: 8080 }, server: "../ProviderPortal" }); })