Commit 4864bfa2 authored by David Sveningsson's avatar David Sveningsson

fix(config): use `readFile` to prevent unintended caching

instead of `require(..)` which caches and can make long-running tools/extensions
not pick up configuration changes properly without restarting.
parent 81616f81
Pipeline #94815216 passed with stages
in 8 minutes and 53 seconds
......@@ -46,8 +46,8 @@ function mergeInternal(base: ConfigData, rhs: ConfigData): ConfigData {
function loadFromFile(filename: string): ConfigData {
let json;
try {
// eslint-disable-next-line security/detect-non-literal-require
json = require(filename);
const data = fs.readFileSync(filename, "utf-8");
json = JSON.parse(data);
} catch (err) {
throw new ConfigError(
`Failed to read configuration from "${filename}"`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment