gulp

Calling gulp-notify without using .pipe()

被刻印的时光 ゝ 提交于 2019-12-03 02:50:01
In my gulpfile.js I have a task that calls two other tasks. When the previous tasks have run, a notification should be triggered. var notify = require('gulp-notify'); gulp.task('build', ['build:js', 'build:css'], function() { console.log('hello', arguments); gulp.src('gulpfile.js').pipe( notify({ title: 'Production Build', message: 'Done' }) ); }); Is there a way to trigger notify without calling gulp.src('gulpfile.js').pipe( first? While not a real problem, this approach feels unnecessary to me. It is entirely possible that my question results from an insufficient understanding of gulp. So

Angular 2 Ahead-of-Time Compiler with gulp-typescript

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Angular 2 rc 6 written in Typescript 2.0.2 I'm trying to learn Ahead-of-Time compilation as outlined here . It seems simple enough: Run ngc instead of the Typescript compiler to generate .ngfactory.ts files Replace platformBrowserDynamic().bootstrapModule() with platformBrowser().bootstrapModuleFactory() I'm not sure how to apply the first step to my setup. I use gulp-typescript 2.13.6 to compile my typescript to JavaScript. gulpfile.js var ts = require ( 'gulp-typescript' ); var tsProject = ts . createProject ( 'tsconfig.json' , {

no command 'gulp' found - after installation

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After installing gulp.js via NPM i receive a no command 'gulp' found error when running the gulp command from the same directory it was installed into. When looking under the node_modules/.bin/ directory i can see the gulp executable there. Is there something wrong with my NPM installation? 回答1: That's perfectly normal. If you want gulp-cli available on the command line, you need to install it globally. npm install --global gulp-cli See the install instruction . Also, node_modules/.bin/ isn't in your $PATH . But it is automatically added by

Can Gulp overwrite all src files?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Let's say I want to replace the version number in a bunch of files, many of which live in subdirectories. I will pipe the files through gulp-replace to run the regex-replace function; but I will ultimately want to overwrite all the original files . The task might look something like this: gulp.src([ './bower.json', './package.json', './docs/content/data.yml', /* ...and so on... */ ]) .pipe(replace(/* ...replacement... */)) .pipe(gulp.dest(/* I DONT KNOW */); So how can I end it so that each src file just overwrites itself, at its original

Gulp Sass - How to properly name the output css?

為{幸葍}努か 提交于 2019-12-03 02:32:21
I'm reading a tutorial about sass here then I tried some other approach and I cant get the answer in this tutorial. Theres the problem. I have this code in my gulpfile.js gulp.task('compileNavbar', function() { gulp.src('assets/css/sass/**/*.navbar.scss') .pipe(sass('navbar.css')) .pipe(gulp.dest('assets/css/'));; }); As of now, I only have assets/css/sass/guest.navbar.scss and this code locates the scss files correctly and puts the output css file in the correct directory BUT the css is named as guest.navbar.css which I didnt expect. I want it to be named as navbar.css but how to? ddprrt gulp

Gulp Error: watch ENOSPC

匿名 (未验证) 提交于 2019-12-03 02:30:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi i'm getting this error while running gulp watch. im using vueify in laravel project. why is this happening. it was working fine all these days and this came in today. $ gulp watch [12:56:01] Using gulpfile ~/Documents/web_projects/next-home/gulpfile.js [12:56:01] Starting 'watch'... [12:56:01] Starting 'browserify'... Fetching Browserify Source Files... - resources/assets/js/app.js Saving To... - public/js/app.js [12:56:02] Finished 'browserify' after 707 ms [12:56:02] 'watch' errored after 722 ms [12:56:02] Error: watch /home/bazi

Gulp-sass fails to compile scss file

南笙酒味 提交于 2019-12-03 02:23:43
I'm using Gulp to compile my sass into css. A simple task compiles the style.scss file in the _/sass directory and saves the output into the root of the project. style.scss is used merely to import other files in the _/sass directory. When I run the default task from the command line ( $ gulp ) I get an error that the sass can't compile. It is included below in full. I have removed all content from the included files and run the task again. I still receive the same error (something I read online suggested this might test for an encoding issue. I don't fully understand encoding and how that

GULP: gulp is not defined

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: As shown in the screen shot below I am not able to run gulp to concat the JavaScript files. Its saying that gulp is not defined . I have tried the following commands: npm install -g gulp npm install gulp npm install gulp --save-dev I have also set the environment variables as following: C:\Users\<user>\AppData\Roaming\npm;C:\Python27;C:\Users\<user>\AppData\Roaming\npm\node_modules;C:\Users\<user>\AppData\Roaming\npm\node_modules\gulp; var concat = require('gulp-concat'); var rename = require('gulp-rename'); var uglify = require('gulp-uglify

External source maps for minified, transpiled ES6 code with webpack and gulp

痞子三分冷 提交于 2019-12-03 02:19:47
I'm writing ES6 code and transpile it to ES5 with Babel, then minify with Uglify. All run with webpack via gulp. I would like to use external source maps (to keep filesize as small as possible). The gulp task is pretty basic - all the funky stuff is in the webpack config: var gulp = require("gulp"); var webpack = require("gulp-webpack"); gulp.task("js:es6", function () { return gulp.src(path.join(__dirname, "PTH", "TO", "SRC", "index.js")) .pipe(webpack(require("./webpack.config.js"))) .pipe(gulp.dest(path.join(__dirname, "PTH", "TO", "DEST"))); }); webpack.config.js: var path = require("path"

How to use Grunt/Gulp with pm2?

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: pm2 is a great tool to manage node apps. How does it work with grunt/glup ? I didn't find any useful clues after Googling for 20 minutes. 回答1: If I understand your question well, it seems you want to deploy your app. Since pm2 0.9 deployment can be done with pm2 deploy see README . In the case of grunt/gulp, I see two options: You've your node_modules comitted. Using pm2 deploy run your gulp process from the post-deploy section: "post-deploy" : "node ./node_modules/gulp/bin/gulp.js ./GulpFile.js && pm2 startOrRestart ecosystem.json --env