gulpfile.babel.js not used if parent directory has a gulpfile.js
See original GitHub issueWhat were you expecting to happen?
for directory structure like
project-dir/
submodules/
my-module/
gulpfile.babel.js
gulpfile.js
when i run gulp
in the project-dir/submodules/my-module
directory i expected it to use project-dir/submodules/my-module/gulpfile.babel.js
.
What actually happened?
it uses project_dir/gulpfile.js
.
if i change the name of project-dir/gulpfile.js
to project-dir/gulpfile.babel.js
it works as expected.
(as the example directory structure suggests, this problem cropped up when changing a submodule in a project to use gulpfile.babel.js
while the main repo was still using gulpfile.js
)
Please post a sample of your gulpfile (preferably reduced to just the bit that’s not working)
it doesn’t matter what’s in the gulpfile
. you can reproduce via:
mkdir project-dir
cd project-dir
npm init -y
npm install --save-dev gulp
touch gulpfile.js
mkdir -p submodules/my-module
cd submodules/my-module
npm init -y
npm install --save-dev gulp babel-register
touch gulpfile.babel.js
gulp -T
output shows gulp walking up the directory tree to gulpfile.js
:
[21:49:03] Working directory changed to /private/tmp/project-dir
[21:49:03] Using gulpfile /private/tmp/project-dir/gulpfile.js
[21:49:04] Tasks for /private/tmp/project-dir/gulpfile.js
then if you
mv ../../gulpfile.js ../../gulpfile.babel.js
gulp -T
you’ll see it use the correct file:
[21:50:08] Requiring external module babel-register
[21:50:08] Using gulpfile /private/tmp/project-dir/submodules/my-module/gulpfile.babel.js
[21:50:08] Tasks for /private/tmp/project-dir/submodules/my-module/gulpfile.babel.js
What version of gulp are you using?
$ gulp --version
[21:36:13] Requiring external module babel-register
[21:36:13] CLI version 3.9.1
[21:36:13] Local version 3.9.1
What versions of npm and node are you using?
$ npm --version
3.10.3
$ node --version
v6.6.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top GitHub Comments
This was just fixed in
findup-sync@0.4.3
- please upgrade your dependency tree.I’m having the same issue.
Also, if the parent dir doesn’t have a gulpfile, gulp returns an error
Local gulp not found in <parent-dir>
. In my project, it’s looking for the gulpfile three levels up the file tree from where I’m running gulp