Re-generate:types on the fly

default discord avatar
lauge.com
2 months ago
3

How to setup the dev script to also re generate:types in the package.json?

  • default discord avatar
    leonardstruck
    2 months ago

    just change your nodemon.json to:



    {
      "ext": "ts",
      "exec": "yarn generate:types && ts-node src/server.ts",
      "ignore": "src/payload-types.ts"
    }
  • default discord avatar
    tais.m
    4 weeks ago

    hey @leonardstruck, I tried your suggestion, but since

    generate:types

    starts the server, I get an error that there's already something on the port when nodemon tries to run

    ts-node src/server.ts

    🤔 am I missing something?

  • default discord avatar
    leonardstruck
    4 weeks ago

    I can't recall running into this at all.. Maybe you have some zombie node process running in the background? You could try

    killall node
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.