Closed bjg2 closed 5 years ago
There is a different behavior between --gulpfile
option and flags.gulpfile
in .gulp.js
. --gulpfile
options changes cwd but flags.gulpfile
does not. These behaviors are still under consideration.
Maybe you can work that by the following way:
.gulp.json
in other_folder
and modify gulpfile.ts
path.gulp test --cwd other_folder
. (flags.cwd
is not supported yet, sorry.)So it is not possible currently to have configs in .gulp.json
(not in CLI), write gulpfile in typescript, and to have gulpfiles in other folders. :) Ok, I will align, but I am eagerly waiting for .gulp.js
flags to be taken as default and CLI ones as override (I guess that is what everyone using .gulp.json
expects to happen).
@bjg2 Sorry, I've mistaken. This problem is not about cwd but about autoloading a gulpfile in .gulp.js
.
The cause is the lacking of preparing loader for a gulpfile in .gulp.js
. The same process for a gulpfile by cli option is executed in liftoff
by using rechoir
.
I'll try to fix this issue this weekend.
but I am eagerly waiting for
.gulp.js
flags to be taken as default and CLI ones as override (I guess that is what everyone using.gulp.json
expects to happen).
OK. I'll address that after this issue.
A fix for this has been published in gulp-cli 2.1.0!
It works! Thanks!
gulp version 4.0.0 gulp CLI version 2.0.1
Please take a look at gulp-typescript-fail repo, there is a small repro.
gulp test
is not working andgulp test --gulpfile other_folder/gulpfile.ts
is working, even though the same gulpfile is defined in.gulp.json
. Also, if I executegulp test --gulpfile other_folder/gulpfile.ts
silent flag in.gulp.json
is completely ignored, while it is working as expected if provided via CLI.Even if I move
gulpfile.ts
is in the root and I change.gulp.json
to point atgulpfile.ts
, silent flag in the.gulp.json
is working for default messages but is ignored for ts one and[22:39:59] Requiring external module ts-node/register
is written. The same is not written if it is provided via CLI asgulp test --silent
.So the
.gulp.json
is not working for me, am I doing something wrong? How can we fix this?