Skip to content

I am unable to share drizzle schema between two backend #1249

Closed Answered by riteshreg
riteshreg asked this question in Q&A
Discussion options

You must be logged in to vote

Here is my solution,
I am using nestjs as my second backend

  1. In packages/db update the tscofig so that javascript file also emit in dist (my whole tsconfig.json)

{
"extends": "@acme/tsconfig/internal-package.json",
"include": ["src"],
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"module": "esnext", // Use modern module system
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": false, // Ensure this is false to emit JavaScript
"noEmit": false,
"outDir": "./dist" // Specify output directory
}
}

  1. In package.json export .js file also (my package.json exports)
    "exports": {
    ".": {
    "types": "./dist/index.d.ts",
    "default": "./dist/index.js"
    },
    "./client": {
    "types":…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@riteshreg
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by riteshreg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants