Run multiple scripts for a single package #636
Replies: 1 comment 9 replies
-
I've tested what you explained above, and it works perfectly. I've left below an example of how to configure // turbo.json
{
"baseBranch": "origin/main",
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
},
"dev:preview": {
"cache": false,
"dependsOn": ["dev"]
}
}
} // root package.json
{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev",
"dev:preview": "turbo run dev:preview",
"lint": "turbo run lint",
},
"packageManager": "pnpm@6.26.1"
} // target package.json from packages
{
"name": "MY_PACKAGE_NAME",
"scripts": {
"build": "YOUR BUILD SCRIPT",
"dev": "YOUR DEV SCRIPT",
"dev:preview": "YOUR DEV:PREVIEW SCRIPT",
"lint": "YOUR LINT SCRIPT",
}
} If it still doesn't work, give me some reproduction code to see your environment. |
Beta Was this translation helpful? Give feedback.
9 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.
-
Hi! Thanks for creating a better way of managing monorepos!
I've got a repository that needs 2 scripts to run in parallel in order to work on it:
dev
anddev:preview
. How can I configure Turborepo so when I run the root-levelnpm run dev
(turbo run dev --parallel
), it automatically runs both scripts in one of the repos?Things I've tried
I've tried adding a new
dev:preview
command to the pipeline but that had no effect.Beta Was this translation helpful? Give feedback.
All reactions