Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.gulp.json not working well with gulpfile.ts #181

Closed
bjg2 opened this issue Feb 19, 2019 · 6 comments
Closed

.gulp.json not working well with gulpfile.ts #181

bjg2 opened this issue Feb 19, 2019 · 6 comments
Labels

Comments

@bjg2
Copy link

bjg2 commented Feb 19, 2019

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 and gulp test --gulpfile other_folder/gulpfile.ts is working, even though the same gulpfile is defined in .gulp.json. Also, if I execute gulp 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 at gulpfile.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 as gulp test --silent.

So the .gulp.json is not working for me, am I doing something wrong? How can we fix this?

@bjg2 bjg2 changed the title flags.gulpfile in .gulp.json not working well with typescript .gulp.json not working well with gulpfile.ts Feb 19, 2019
@sttk
Copy link
Contributor

sttk commented Feb 20, 2019

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:

  1. Move .gulp.json in other_folder and modify gulpfile.ts path.
  2. Run the command gulp test --cwd other_folder. (flags.cwd is not supported yet, sorry.)

@bjg2
Copy link
Author

bjg2 commented Feb 20, 2019

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).

@sttk sttk added the bug label Feb 21, 2019
@sttk
Copy link
Contributor

sttk commented Feb 21, 2019

@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.

@sttk
Copy link
Contributor

sttk commented Feb 21, 2019

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.

@phated
Copy link
Member

phated commented Mar 26, 2019

A fix for this has been published in gulp-cli 2.1.0!

@bjg2
Copy link
Author

bjg2 commented Mar 28, 2019

It works! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants