Skip to content

Instantly share code, notes, and snippets.

@asciant
Created November 10, 2023 21:20
Show Gist options
  • Save asciant/fb41532ce38a5c79d32677394a39ab68 to your computer and use it in GitHub Desktop.
Save asciant/fb41532ce38a5c79d32677394a39ab68 to your computer and use it in GitHub Desktop.
Seed with ts-node

Install the required packages:

pnpm install tsconfig-paths ts-node --save-dev

Update the package.json

"seed": "ts-node drizzle/seed.ts"

Update the tsconfig.json

  "ts-node": {
    "compilerOptions": {
      "module": "CommonJS"
    },
    "require": ["tsconfig-paths/register"],
    "paths": {
      "@/*": ["./*"]
    }
  }

Run the seed command

pnpm run seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment