gulp

Convert gulp watch in gulp@3.9.1 to gulp@4

拟墨画扇 提交于 2019-12-20 06:29:36
问题 We are switching from gulp@3.9.1 to gulp@4 and are having trouble switching over. When we run gulp watch , we are getting the following errors and trying to figure out how to resolve it. What is the proper way to convert the gulp watch task to work with gulp@4 ? Error message AssertionError [ERR_ASSERTION]: Task never defined: minify-css Command: gulp watch This should run minify-js then minify-css in order minify-js should run after clean-scripts has completed successfully minify-css should

Gulp remove duplicates if exists

大城市里の小女人 提交于 2019-12-20 06:16:53
问题 Is it possible to remove files with same name from source? For example, let's say I have the following folder structure a ---file1.txt ---file2.txt ---file3.txt b ---file1.txt When I select both folder in source I want in destination folder only file that aren't duplicates. In example above result would be result ---file2.txt ---file3.txt Optional, it would be great if I could duplicates somehow filter and write in separate folder. By duplicates, I mean explicitly duplicates by name, file

“Task function must be specified at Gulp.set” error when running gulp

蓝咒 提交于 2019-12-20 06:07:19
问题 I always have the same error when installing gulp: C:\Users\Thomas\Desktop\Sites CT Graphics\colpaertmarc.be>gulp assert.js:350 throw err; ^ AssertionError [ERR_ASSERTION]: Task function must be specified at Gulp.set [as _setTask] (C:\Users\Thomas\Desktop\Sites CT Graphics\colpaertmarc.be\node_modules\undertaker\lib\set-task.js:10:3) at Gulp.task (C:\Users\Thomas\Desktop\Sites CT Graphics\colpaertmarc.be\node_modules\undertaker\lib\task.js:13:8) at Object. (C:\Users\Thomas\Desktop\Sites CT

Pass argument from script to gulp task

耗尽温柔 提交于 2019-12-20 04:37:22
问题 I have package.json scripts with the following structure: "scripts": { "watch:build": "tsc --watch", "watch:server": "nodemon ./src/app.js --watch 'app'", "build": "tsc && gulp do_something", "start": "npm-run-all clean build --parallel watch:build", "watch:server --print-label" } I would like to start the application as npm run start with_argument and pass it to build script, to perform actions in the gulp task based on that argument. I read a lot of tutorial and how to articles, but without

Node.js event-stream: Where to setMaxListeners?

佐手、 提交于 2019-12-20 04:31:09
问题 I have searched and searched for this, to no avail. I've combed the web (including Stackoverflow), and the Node docs for an answer, and not found one---that worked (maybe that's just bad searching on my part). I'm working with an event-stream in a gulp config file, and I have a particular task that is hitting the classic "memory leak detected" error from the EventEmitter class. From what I've found, the answer to dealing with this issue seems to be to call the setMaxListeners method of the

Node.js event-stream: Where to setMaxListeners?

一世执手 提交于 2019-12-20 04:31:08
问题 I have searched and searched for this, to no avail. I've combed the web (including Stackoverflow), and the Node docs for an answer, and not found one---that worked (maybe that's just bad searching on my part). I'm working with an event-stream in a gulp config file, and I have a particular task that is hitting the classic "memory leak detected" error from the EventEmitter class. From what I've found, the answer to dealing with this issue seems to be to call the setMaxListeners method of the

Gulp inject not working

点点圈 提交于 2019-12-20 02:54:23
问题 I'm try to use gulp-inject to inject some files into a PHP file. This is not working. I tried using HTML as well but that isn't working. The output in my console says "gulp-inject 6 files into test.html" however there's no files injected. The # of files is correct because I do have 6 JavaScript files in the directory i'm looking at in my Gulp file. Here's my Guilp task: var inject = require('gulp-inject'); gulp.task('build',function() { return gulp.src("src/test.html") .pipe(inject(gulp.src(

Visual Studio Code complains that it “Cannot find namespace” for types defined in *.d.ts files

痴心易碎 提交于 2019-12-20 01:09:47
问题 I created a new project using the gulp-angular Yeoman generator with language set to TypeScript. Then ran the Gulp build process and also opened the page in a web browser, which all worked without any bigger problems. I only had to replace ref: "master" in the tsd.json with ref: "1.4.1" to make the build work. Basically I executed following commands: yo gulp-angular vim tsd.json gulp gulp serve code . Afterwards I opened the project in Visual Studio Code. Now, Visual Studio Code complains for

Module not found: Error: Can't resolve 'fs'

蹲街弑〆低调 提交于 2019-12-20 01:03:47
问题 I working on a Laravel 5.3 project. I am getting below errors when I am running gulp command in CMD. Could anyone say how can I get a error less result ? gulpfile.js var elixir = require('laravel-elixir'); require('laravel-elixir-vue'); elixir(function(mix) { mix.sass('app.scss'); }); elixir(function(mix) { mix.webpack('app.js'); }); elixir(function(mix) { mix.version(['css/app.css', 'js/app.js']); }); package.json { "private": true, "scripts": { "prod": "gulp --production", "dev": "gulp

Gulp Sass not compiling partials

心不动则不痛 提交于 2019-12-19 19:31:44
问题 So I am using Gulp Sass with gulp-changed (i've also tried gulp-newer with the updated syntax changes) and watching all the scss files in my folders. When I change a base scss file it will compile without any problems. However if I change a partial it won't compile the sass file that has a dependency on that partial. Gulp var SRC = './stylesheets/**/*.scss'; var DEST = './stylesheets'; gulp.task('sass', function() { return gulp.src(SRC) .pipe(changed(DEST, { extension: '.css' })) .pipe