We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
root
1 parent 0151662 commit 58d81e3Copy full SHA for 58d81e3
packages/config/src/lib/config.ts
@@ -47,12 +47,19 @@ const importUp = async <T>(dir: string, name: string): Promise<T> => {
47
for (const ext of extensions) {
48
const filePathWithExt = `${filePath}${ext}`;
49
if (fs.existsSync(filePathWithExt)) {
50
+ let config: T;
51
+
52
if (ext === '.mjs') {
- return import(filePathWithExt).then((module) => module.default);
53
+ config = await import(filePathWithExt).then((module) => module.default);
54
} else {
55
const require = createRequire(import.meta.url);
- return require(filePathWithExt);
56
+ config = require(filePathWithExt);
57
}
58
59
+ return {
60
+ root: dir,
61
+ ...config,
62
+ };
63
64
65
0 commit comments