Am I supposed to be using deno task
in order to run something something like npm:create-svelte
?
#25744
-
Previous discussion here but I got no feedback there, so I'm bringing it over here. Apparently,
Hi! Thank you for your explanation. I'm new to
Suppose I want to execute Suppose I were to generalize a bit, and define a codebase to be "my home directory". Then, I guess I would put a {
"tasks": {
"create-svelte": "deno run -A npm:create-svelte@latest"
}
} I am not sure about the above because setting up a ...to the point where I did not expect it to work. Yet it did! And when it did, I was surprised, and tried a bare ...which also worked? Huh. I made sure I've enabled
So, why does this work now? I am using:
So...is |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I think you're taking the The motivation behind tasks is to abstract common complex tasks that you need to run daily. A typical use case is that there is a deno run -A --watch-hmr my-app.ts Now you could of course always type out the whole command by hand yourself. This gets very tedious though. You could put this in a shell file, but then have to deal with different developers using different shells and operating systems, which all have a different syntax. Windows has PowerShell, macOS has zsh and linux typically has bash or sometimes fish. It's not something you want to bother with as a developer, and neither should your team mates. So what if you could just call We can solve this headache by adding a This all can be solved with tasks. Let's add a task for development setup of our imaginary project: {
"tasks": {
"dev": "deno run -A --watch-hmr my-app.ts"
}
} This means now you can just call |
Beta Was this translation helpful? Give feedback.
That was a bug that we fixed. There shouldn't be any error.
Because we fixed that bug. It occurred because we also added support for running
tasks
defined indeno.json
viadeno run
to make it easier for folks swichting fromnpm
. We missed an important edge case leading to the weird behavior you described.Yes, please do. That's the way to do it 👍