gulp

Run Protractor with a single Gulp task

怎甘沉沦 提交于 2019-12-04 12:15:46
问题 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? 回答1: Here is a solution that can work var protractor = require("gulp-protractor").protractor; var spawn = require('child

Run gulp task after completion of other task

大城市里の小女人 提交于 2019-12-04 12:15:35
I have two sets of files, let's call them base and mods . The mods files override the base files, so when I run the gulp task related to base , I need to run the mods task directly after. My setup is something like this: gulp.task('base',function(){ return gulp.src('base-glob') .pipe(...) .pipe(gulp.dest('out-glob')) }); gulp.task('mods',function(){ return gulp.src('mods-glob') .pipe(...) .pipe(gulp.dest('out-glob')) }); So I want to run the mods task at the completion of the base task. Note that this is not the same as defining base as a dependency of mods , because if I'm only changing mods

Cant make gulp-notify to pop up a error message when gulp-jshint fail

梦想与她 提交于 2019-12-04 12:08:57
So, was the whole day working on our new FE workflow, the main idea is to run a few tasks through a watcher, we will have our IDE's and a window with the browsers getting refreshed each time something change (scss, js, html, etc). So, we wont see nothing if all went good: the browser will get reload and we will keep working. But, we want to use gulp notify for errors, so in case we have something wrong, the notifier pop up will appear, and at that point, you can check the console and see the error. Example for our sass task when fail: For our styles tasks, everything works fine, but Im not

Gulp SASS Sourcemap sources are incorrect

旧时模样 提交于 2019-12-04 11:07:21
I am struggling to get my SASS sourcemaps to work correctly. The problem seems to be the "sources" attribute within the sourcemap and how my SASS files are nested. I have a Gulp task that compiles SASS to CSS. Here is an example of that var paths = { styles: { src: './Stylesheets/SCSS/', files: './Stylesheets/SCSS/**/*.scss', dest: './Stylesheets/CSS/' } } gulp.task('compile-sass', function (){ return gulp.src(paths.styles.files) .pipe(sourcemaps.init()) .pipe(sass({ outputStyle: 'compressed', includePaths : [paths.styles.src] })) .pipe(prefix({ browsers: ['last 2 Chrome versions'], cascade:

gulp browserify bundle time takes too long

为君一笑 提交于 2019-12-04 11:06:15
I've ran into a strange issue and need your help to figure what's going on. I've configured gulp to build my a test up written in React.js in ES6. I've used browserify to setup the CommonJS env and babelify for bigger ES6 support. And everything works, it just takes too long (in my opinion) to build if React is required as CommonJS module. Meaning this import React from 'react'; line will raise the bundle/compile time from 1.2secs to around 4secs on the initial build, then when any changes are detected it takes around 2.5secs to rebuild the js files. And this time rapidly goes up when more

Browserify basedir option (RequireJS-like)

雨燕双飞 提交于 2019-12-04 10:47:34
问题 I cannot figure out how the browserify basedir option works.. Note : I may be wrong in my understanding of the whole basedir concept because I'm coming from RequireJS (think baseUrl ). EDIT Indeed I was wrong, but you can still achieve what I was trying to do with the paths option, see my answer below. I understand that the basedir option gives you the ability (the freedom!) to specify all require paths (starting with a . ) from a static root/base dir.. And NOT from process.cwd() .. This is

Gulp.js stops compiling LESS when watched after there has been an error in the LESS files

半腔热情 提交于 2019-12-04 10:44:39
问题 I'm having a problem with gulp . I run gulp-watch along with gulp-less and gulp-clean . Everything is running perfectly. When I edit somefile.less and I save it with a semi-colon missing or maybe I accidentally leave a trailing ;s , just have errors in my code when saving, gulp-less logs an error in the console. After I fix it gulp-watch continues watching the files, but gulp-less doesn't fire and it doesn't compile. When I stop gulp and run it again in the terminal everything goes back to

gulp-uglify events.js unhandled 'error' event

ⅰ亾dé卋堺 提交于 2019-12-04 10:22:24
问题 I'm getting this error. Running gulp yesterday worked perfectly fine, but this morning (changed NO code) and I'm getting this error. $ gulp [08:54:10] Using gulpfile C:\Source\Source2\bunny-meadows\gulpfile.js [08:54:10] Starting 'scripts'... [08:54:10] 'scripts' errored after 11 ms [08:54:10] TypeError: listener must be a function at TypeError (<anonymous>) at DestroyableTransform.addListener (events.js:130:11) at DestroyableTransform.Readable.on (C:\Source\Source2\bunny-meadows\node_mo

Gulp Watch only run once

落花浮王杯 提交于 2019-12-04 09:57:33
问题 I'm using this Gulp Watch sample: https://github.com/floatdrop/gulp-watch/blob/master/docs/readme.md#starting-tasks-on-events. var gulp = require('gulp'); var watch = require('gulp-watch'); var batch = require('gulp-batch'); gulp.task('build', function () { console.log('Working!'); }); gulp.task('watch', function () { watch('**/*.js', batch(function () { gulp.start('build'); })); }); When I run it on my Windows 8 machine, it only runs the first time I change a file: C:\test>gulp watch [08:40

Chain Gulp glob to browserify transform

这一生的挚爱 提交于 2019-12-04 09:55:57
I have a project with a few relatively disjoint pages, each including their own entry point script. These scripts require a number of others using commonjs syntax, and need to be transformed by 6to5 and bundled by browserify. I would like to set up a gulp task that captures all the files matching a pattern and passes them on to the bundler, but I'm not sure how to pass files from gulp.src to browserify(filename) . My gulpfile looks like: var gulp = require("gulp"); var browserify = require("browserify"); var to5browserify = require("6to5-browserify"); var source = require("vinyl-source-stream"