robatron / gulp-chug Goto Github PK
View Code? Open in Web Editor NEWRun external gulpfiles as part of a gulp task inside another gulpfile
Run external gulpfiles as part of a gulp task inside another gulpfile
We're running into an issue where the process that calls gulp-chug may exit prematurely with 0 before the spawned gulp-chug process finishes, which kills the spawned gulp-chug process.
Make tasks that calls gulp-chug synchronous, e.g.,
var gulp = require('gulp');
var chug = require('gulp-chug');
gulp.task('default', function(){
return gulp.src('**/gulpfile.js')
.pipe(chug());
});
i use gulp-chug
in our project , it is great. and i can't find other elegant way to solve my problem.(better than gulp-hub
)
even it is in the blacklist, it is useful. tks for your work.
I get the following error with gulp-chug in one of my (customer) projects:
Error: No module loader found for ".tmp.1443527063128.js".
at Object.exports.prepare (/Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/node_modules/rechoir/index.js:18:11)
at Liftoff.buildEnvironment (/Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/index.js:127:25)
at Liftoff. (/Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/index.js:192:32)
at module.exports (/Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)
at Liftoff. (/Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/index.js:185:9)
at /Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/liftoff/index.js:159:9
at /Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/v8flags/index.js:91:14
at /Users/mikael/repos/HappyOrNot/webshop/server/lambda-functions/HoN-cc-fingerprint/node_modules/gulp/node_modules/v8flags/index.js:38:7
The error seems to be related to the file naming of the temp file. Changing it to use _ instead of . as the delimiters fixes the issue.
I tried running my current gulp & gulp-chug file that works with 0.12 on the newly released 4.0.0 and got the following error output:
[09:14:05] Error in plugin 'gulp-chug'
Message:
Gulpfile /Users/dwolfe2/Sites/adventure-coffee/game/assets/gulpfile.js exited with an error :(
[09:14:05] 'build' errored after 3.25 s
[09:14:05] Error: [object Object]
at formatError (/Users/dwolfe2/.nvm/versions/node/v4.0.0/lib/node_modules/gulp/bin/gulp.js:169:10)
at Gulp. (/Users/dwolfe2/.nvm/versions/node/v4.0.0/lib/node_modules/gulp/bin/gulp.js:195:15)
at emitOne (events.js:82:20)
at Gulp.emit (events.js:169:7)
at Gulp.Orchestrator._emitTaskDone (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
at /Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/index.js:275:23
at finish (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at cb (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
at finish (/Users/dwolfe2/Sites/adventure-coffee/node_modules/run-sequence/index.js:38:5)
at Gulp.onError (/Users/dwolfe2/Sites/adventure-coffee/node_modules/run-sequence/index.js:45:4)
at emitOne (events.js:82:20)
at Gulp.emit (events.js:169:7)
at Gulp.Orchestrator._emitTaskDone (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
at /Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/index.js:275:23
at finish (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at DestroyableTransform. (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:52:4)
at DestroyableTransform.f (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp/node_modules/orchestrator/node_modules/end-of-stream/node_modules/once/once.js:17:25)
at emitOne (events.js:82:20)
at DestroyableTransform.emit (events.js:169:7)
at sayErr (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp-chug/index.js:40:18)
at ChildProcess. (/Users/dwolfe2/Sites/adventure-coffee/node_modules/gulp-chug/index.js:172:17)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
Gulp since version 3.9 supports gulpfile written in es6 (babel). It would be great if gulp-chug could support babel. Right now I getting syntax error. Update dependency to new version of gulp didn't help.
Is it possible to run the tasks in parallel? I'd love to have a global gulp.watch()
that calls watch in each folder, but because the task doesn't return/fire the callback, then the watch just sits on the first file and doesn't advance to the other gulpfiles.
They are a bit annoying to manage.
Sometimes gulp crashes and more and more tmp files get piled up. I currently write clean tasks for them and add them to git/svn ignore so they don't confuse me. But it would be nice if they weren't there at all.
By the way thanks for this plugin. I noticed that the gulp folk blacklisted it, i'm a bit sad about that. Are you still planning on continuing updating this, given the circumstances ?
I'm trying to match all subdirectories of a given directory.
I want to match all .js files inside subdirectories:
/path/to/dir/dir1/*.js
/path/to/dir/dir2/dir3/*.js
/path/to/dir/dir4/*.js
While excluding:
/path/to/dir/
I'm using the following pattern:
/path/to/dir/**/*.js
When I run the gulp task, I get the following error:
Unable to find local gulp. Try running 'npm install gulp' /path/to/dir/.
Shouldn't /path/to/dir/ be excluded by the given pattern? Why is it looking for gulp on a directory that I don't want to be matched?
Thanks in advance!
I've found your module to be just what I need. Please try to keep it healthy.
Running gulp-chug is giving me this message on every line of output (quite noisy)
util.print: Use console.log instead
I've got a project with randomly distributed subbuilds, each with its own gulpfile.js
that contains a ci
task. I'm trying to consolidate ci
to a root command with
gulp.task('ci', function () {
return gulp.src('./src/**/gulpfile.js', { read : false })
.pipe(chug({ tasks : ['ci'] }));
});
which yields
[gulp] Error in plugin 'gulp-chug': Error executing gulpfile .../src/template/decode/gulpfile.js:
at sayErr (.../node_modules/gulp-chug/index.js:43:33)
at .../node_modules/gulp-chug/index.js:152:17
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
{read:false}
, chug creates a temporary gulpfile.js rooted at the glob's base (./src/**/gulpfile.js
-> ./src/gulpfile.tmp.[guid].js
), and then a relative require within the new gulpfile breaks.For now, I'm explicating all of the gulpfiles, but I'd rather use a glob.
... exits with an error. What's going on with that?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.