Summary
"stagingDir" property in bsconfig.json is not resolved relative to the config file
Repro steps
given the below two config files
- ./node_modules/shared-config/bsconfig.json
"rootDir": "../../src",
"stagingDir": "../../build"
- ./bsconfig.json
{
"extends": "./node_modules/shared-config/bsconfig.json",
}
- results in two different path resolutions
import {Util} from "brighterscript"
const util = new Util()
const config = util.loadConfigFile("./bsconfig.json");
console.log(`rootDir: ${config.rootDir}`)
console.log(`stagingDir: ${config.stagingDir}`)
Expected result:
$ rootDir: {cwd-dir}/src
$ stagingDir: {cwd-dir}/build
Actual result:
$ rootDir: {cwd}/src
$ stagingDir: {cwd}/../../build
Details
path normalisation is missing in the loadConfigFile utility for the stagingDir
|
//make any paths in the config absolute (relative to the CURRENT config file) |
|
if (result.outFile) { |
|
result.outFile = path.resolve(projectFileCwd, result.outFile); |
|
} |
|
if (result.rootDir) { |
|
result.rootDir = path.resolve(projectFileCwd, result.rootDir); |
|
} |
|
if (result.cwd) { |
|
result.cwd = path.resolve(projectFileCwd, result.cwd); |
|
} |
|
return result; |
Summary
"stagingDir" property in
bsconfig.jsonis not resolved relative to the config fileRepro steps
given the below two config files
{ "extends": "./node_modules/shared-config/bsconfig.json", }Expected result:
Actual result:
Details
path normalisation is missing in the
loadConfigFileutility for thestagingDirbrighterscript/src/util.ts
Lines 227 to 237 in 483a154