gulp

Cancel Build if Task Runner Explorer Task Fails

南笙酒味 提交于 2019-12-03 05:54:42
I am using visual studio task runner (2015) to run a Gulp task bound to before build. I have set it up so that when the gulp tasks fails it sends exit code 1 and at the end it says "Process terminated with code 1." however the build continues. This will cancel the build in team city so seems an issue linked Task Runner inside visual studio. How can I prevent the build from taking place if it exits with a code other than 0? davidmdem You are correct in that this seems to be a Task Runner issue. The task runner does not communicate with MSBuild to stop a build if a BeforeBuild task fails. To get

Glob /* doesn't match files starting with dot

喜夏-厌秋 提交于 2019-12-03 05:53:16
I'm using gulp to copy all files from one dir to another using code like this: gulp.src([ 'app/**/*' ]).pipe(gulp.dest('dist')); Glob docs say * match all files, but in fact files which have names starting with dot, like .gitignore , are not copied. How can it be worked around? Tony Barnes If you add the option dot: true , it should work. Eg: gulp.task('something', function () { return gulp.src([ 'app/**/*' ], { dot: true }).pipe(gulp.dest('dist')); }); Reference 来源: https://stackoverflow.com/questions/29533843/glob-doesnt-match-files-starting-with-dot

browser-sync does not refresh page after changes with Gulp

大憨熊 提交于 2019-12-03 05:46:17
问题 I'm new to Gulp and I wanted to make use of its automatic scss compiling and browser sync. But I can't get it to work. I stripped everything down to leave only the contents of the example on the Browsersync website: http://www.browsersync.io/docs/gulp/#gulp-sass-css var gulp = require('gulp'); var browserSync = require('browser-sync').create(); var sass = require('gulp-sass'); // Static Server + watching scss/html files gulp.task('serve', ['sass'], function() { browserSync.init({ server: ".

gulp-sourcemaps: Cannot find module './src/init'

左心房为你撑大大i 提交于 2019-12-03 05:37:13
I get an error while installing React-native, I have tried to search for an answer, but I can not find one. When running "react-native init meet" I get this error: This will walk you through creating a new React Native project in /Users/alfred/React/meet Installing react-native package from npm... Setting up new React Native app in /Users/alfred/React/meet module.js:338 throw err; ^ Error: Cannot find module './src/init' at Function.Module._resolveFilename (module.js:336:15) at Function.Module._load (module.js:286:25) at Module.require (module.js:365:17) at require (module.js:384:17) at Object

CSS minify and rename with gulp

老子叫甜甜 提交于 2019-12-03 05:36:40
问题 I've a variable like var files = { 'foo.css': 'foo.min.css', 'bar.css': 'bar.min.css', }; What I want the gulp to do for me is to minify the files and then rename for me. But the tasks is currently written as (for one file) gulp.task('minify', function () { gulp.src('foo.css') .pipe(minify({keepBreaks: true})) .pipe(concat('foo.min.css')) .pipe(gulp.dest('./')) }); How to rewrite so it work with my variable files defined above? 回答1: You should be able to select any files you need for your src

gulp-uglify events.js unhandled 'error' event

自闭症网瘾萝莉.ら 提交于 2019-12-03 05:35:42
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 dules\gulp-uglify\node_modules\through2\node_modules\readable-stream\lib\_stream _readable.js:729:33) at

How do you use Istanbul Code Coverage with transpiled Typescript?

你。 提交于 2019-12-03 05:31:57
问题 I've been reading articles on this all morning trying to get my environment setup correctly. But for some reason I'm not getting it. My setup- /app ... source (mixed js and ts) /scripts ... copied source (js) typescripts.js // transpiled typescript with inline mapping Tests run fine, and with the mapping debugging in the chrome debugger is mapped correctly. But Istanbul sees the typescripts.js file as one file instead of the concatenation of dozens of other files. To generate the typescript

How to bundle Angular 2 Typescript app using Gulp and SystemJS?

感情迁移 提交于 2019-12-03 04:50:17
问题 I'm using Typescript with SystemJS for module loading and Gulp for task runner in my Angular 2 project. The current version of Angular in the project is RC2 but the problem is present also with RC1. I followed the steps of brando's answer here. After bundling my application and initial load of the website SystemJS throws error: Error: http://localhost:57462/app/app.bundle.js detected as register but didn't execute. The application works but the error in the console definitely is not a good

-bash: gulp: command not found in Mac

白昼怎懂夜的黑 提交于 2019-12-03 04:43:50
I try install gulp in mac like this : Is-iMac:~ itop$ npm root /Users/itop/node_modules Is-iMac:~ itop$ npm config set prefix /usr/local Is-iMac:~ itop$ npm root -g /usr/local/lib/node_modules Is-iMac:~ itop$ sudo npm install -g gulp After Install I see this error In terminal: npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible. npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0. npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3

Minify (not transpile) ES2015 code with Gulp

做~自己de王妃 提交于 2019-12-03 04:41:59
How to minify ES2015 code without transpiling it to ES5? The popular gulp-minify and gulp-uglify modules do not work with simply minifying ES2015 code. It is now possible to minify ES2015 without transpiling the code. babel minify (previously babili) is a babel preset that does that. To install do: npm install --save-dev babel-preset-minify To use it with gulp you do: var gulp = require('gulp') var babel = require('gulp-babel') gulp.task('default', () => { return gulp.src('src/app.js') .pipe(babel({presets: ['minify']})) .pipe(gulp.dest('dist')) }) Currently, the only way to minify ES2015 with