Replies: 1 comment
-
|
You would have to use something like ts-node to make this work. typegen.config.js would still need to be js, but if you add require('ts-node/register')
const dbConn = require('./src/dbConnection')
/** @type {import('@slonik/typegen').Options */
module.exports.default = {
pool: dbConn.getPool(),
...otherOptions
}Edit: if using commonjs you'll probably need to stick to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to run
npx slonik-typegen generate --config typegen.config.tsbut it failed with
Error: Cannot use import statement outside a moduleIt seems like I can only use .js files for the config?
But I need to use a ts import because I want to load my db connection to pass for the
poolConfigoption.typegen.config.ts
So is this not possible to do?
Beta Was this translation helpful? Give feedback.
All reactions