T
TanStack5mo ago
adverse-sapphire

How to use tsr watch with other commands in npm scripts?

In the guide stated to update npm scripts to use tsr. While I don't see any troubles with build script, I don't understand how dev script supposed to work.
{
"scripts": {
"generate-routes": "tsr generate",
"watch-routes": "tsr watch",
"build": "npm run generate-routes && ...",
"dev": "npm run watch-routes && ..."
}
}
{
"scripts": {
"generate-routes": "tsr generate",
"watch-routes": "tsr watch",
"build": "npm run generate-routes && ...",
"dev": "npm run watch-routes && ..."
}
}
It means that subsequent commands in dev script will run after npm run watch-routes command finishes. But because it is in watching mode, it wouldn't stop until you press Ctrl+C. So the subsequent commands wouldn't run at all. Am I missing something?
1 Reply
correct-apricot
correct-apricot5mo ago
npm
concurrently
Run commands concurrently. Latest version: 9.1.2, last published: 4 months ago. Start using concurrently in your project by running npm i concurrently. There are 1889 other projects in the npm registry using concurrently.

Did you find this page helpful?