Closed weswigham closed 8 years ago
The require hooks are loaded with node's require
which doesn't take into account a cwd
parameter and instead use process.cwd()
. Liftoff should not be responsible for changing that (although, gulp decides to do that in its CLI). @tkellen do you agree?
So the correct fix would instead be, in gulp
, before it's construction of Liftoff
, using process.chdir
?
@weswigham that would be the only place where we'd consider it. If you open an issue on gulp-cli, we can discuss over there. It would effect this chunk of code: https://github.com/gulpjs/gulp-cli/blob/master/index.js#L131-L137
Closing this.
This way the appropriate
cwd
can be set when allregister
hooks get hooked in. This is an issue in, for example,gulp
when usingts-node
in a subdirectory with--cwd
. Thecwd
passed is not respected by the require hooks included by liftoff since thecwd
is only set duringlaunch
(so it is not set when therequire
hook is loaded).