[ ] π Documentation (updates to the documentation, readme, or JSdoc annotations)
[x] π Bug fix (a non-breaking change that fixes an issue)
[ ] π Enhancement (improving an existing functionality like performance)
[ ] β¨ New feature (a non-breaking change that adds functionality)
[ ] π§Ή Chore (updates to the build process or auxiliary tools and libraries)
[ ] β οΈ Breaking change (fix or feature that would cause existing functionality to change)
π Description
Changes
In run.ts & list.ts from the task command i used createNitro() to have a nitro instance so i could access the options.
i use the nitro.options.builDir to replace the hardcoded ".nitro" buildDir that is passed to the runTask function.
at the end of the command run function i also close the the nitro instance that i created.
Why
Now if your buildDir in the nitro.config.tsis not the default .nitro directory instead of getting an error it uses the correct buildDir and your command will run.
This will also make sure that the task cli works with nuxt, because nuxt uses the the buildDir .nuxt.
updated list & run to get a nitro instance and grab the buildDir from the nitro options and at the close the nitro instance.
π Linked issue
#2634 Task cli forces .nitro as buildDir
β Type of change
π Description
Changes
In run.ts & list.ts from the task command i used
createNitro()
to have a nitro instance so i could access the options. i use thenitro.options.builDir
to replace the hardcoded".nitro"
buildDir that is passed to the runTask function. at the end of the command run function i also close the the nitro instance that i created.Why
Now if your
buildDir
in thenitro.config.ts
is not the default .nitro directory instead of getting an error it uses the correct buildDir and your command will run. This will also make sure that the task cli works with nuxt, because nuxt uses the the buildDir .nuxt.π Checklist