gulp does not support sub projects
See original GitHub issueYou cannot have a gulpfile.js call another gulpfile.js from another project in a subfolder of your project. Consider this canned example:
$ git init
$ git submodule add --force https://github.com/google/web-starter-kit.git
$ git submodule add https://github.com/driftyco/ionic.git
$ pushd ionic/; npm install; popd
$ pushd web-starter-kit/; npm install; popd
$ cat >> gulpfile.js << EOF
var gulp = require('gulp');
var osScaffold = require('./web-starter-kit/gulpfile');
var njsApp = require('./ionic/gulpfile');
gulp.task('default', function() {
//what goes here
});
EOF
$ npm install gulp
$ gulp
[15:42:49] Using gulpfile ~/.tmp/gulpfile.js
[15:42:49] Starting 'default'...
[15:42:49] Finished 'default' after 35 μs
This of course does nothing, but how could it do any thing. I would need to call the default task of each sub project, but they have been replaced by the root project’s default task.
Other problems arise like the following code in a child project:
gulp.task('tarball', function() {
return gulp.src(['**/*')
.pipe(tar('subproject.tar'))
.pipe(gzip())
.pipe(gulp.dest('./dist'));
});
This code will output a tarball of not just the subproject where it lies, but also the root project and the other project. Also it will put that tarball in the dist folder of the root project, not the dist folder of the subproject.
Only way that I know of to do sub projects would be to synchronously fork and call gulp on each gulpfile.js of the sub projects.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Use a gulp task in mulitple projects - Stack Overflow
I made reusable gulp tasks since we had multiple frontend projects all using gulp. The best way I found was to create a...
Read more >gulp-typescript - npm
gulp -typescript. A gulp plugin for handling TypeScript compilation workflow. The plugin exposes TypeScript's compiler options to gulp using ...
Read more >The Working Programmer - How To Be MEAN: Taking a Gulp
This will make sure that Gulp is referenced in the package.json file as a developer dependency, so that if you pull down the...
Read more >Gulp Tasks - Aurelia
Gulp tasks in a CLI application are plain Gulp v4 tasks. Gulp v4 brings gulp.series and gulp.parallel which makes Gulp tasks easier and...
Read more >Gulp | IntelliJ IDEA Documentation - JetBrains
js file, and supports running and debugging tasks. Gulp.js tasks can be run from the tasks tree in the dedicated Gulp Tool Window,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found gulp-hub for that. Simply create a route gulpfile.js like this.
Ahah! I spoke too soon. Gulp 4 is coming out with tasks as exports. This is awesome!