Closed
Description
Hello,
Currently --config does not take absolute paths. For example, doing something like this throws an error:
> browser-sync start --config /etc/bs-config.js
module.js:318
throw err;
^
Error: Cannot find module '/path/to/cwd/etc/bs-config.js'
This is caused by browser-sync/lib/cli/cli-info.js:28
:
return require(path.resolve(process.cwd() + "/" + filePath));
Which tries to resolve relative url by prepending process.cwd(), but that's the job of path.resolve
.
Changing this line to the following does the correct thing, and fixes the issue:
return require(path.resolve(process.cwd(), filePath));
Thanks,
Kexiang