diff --git a/src/config/index.ts b/src/config/index.ts index ca43c219..6a6df7fc 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -147,17 +147,22 @@ type ConfigUtils = { export type Config = T & ConfigUtils; export function withConfigUtils(path: string | null, config: T): Config { - return { - ...config, - resolve: (subpath: string): AbsolutePath => { - if (path === null) { - return resolve(subpath) as AbsolutePath; - } - - return resolve(dirname(path), subpath) as AbsolutePath; + return Object.create(config, { + resolve: { + enumerable: false, + value: (subpath: string): AbsolutePath => { + if (path === null) { + return resolve(subpath) as AbsolutePath; + } + + return resolve(dirname(path), subpath) as AbsolutePath; + }, }, - [configPath]: path === null ? path : resolve(path), - }; + [configPath]: { + enumerable: false, + value: path === null ? path : resolve(path), + } + }); } export async function resolveConfig(