-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
export default {
extends: ['./databases'],
}
// databases.ts
export default {
db1: true,
}the following code will fail to load databases.ts because extension is not provided. JITI is able to load ts files without extensions but when used within context of extends, it is not used to load the file.
further more tryResolve will assume anything without extension is a folder.
Reproduction
// index.ts
import { loadConfig } from 'c12';
const { config: config_data } = await loadConfig({
cwd: dirname(fileURLToPath(import.meta.url)) + '/config',
configFile: './default',
extend: { extendKey: 'extends' },
});// config/detaulf.ts
export default {
//extends: './databases', // cannot find
extends: './databases.ts', // works fine
};// config/databases.ts
export default {
databases: {
host: process.env.DB_HOST,
database: process.env.DB_NAME || 'test_db',
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
port: parseInt(process.env.DB_PORT || '5432'),
name: 'db',
},
$test: {
databases: {
meow: 124,
}
},
};Describe the bug
when using extends, if a file is given without extension it is treated as folder.
Additional context
No response
Logs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working