Deno add --dev flag not doing anything
When execution
deno add --dev @package/example
the package is added to deno.json as import same without the --dev
flag.
I noticed I could add the devDependencies in package.json, but I would like to skip package.json when using deno.
What is the correct way to add dev dependencies with deno ?4 Replies
Deno itself doesn't have the concept of
devDependencies
. The way dependencies work in Deno is that it crawls all reachable dependencies in the entry point file and only downloads those. In other words dev and prod dependencies are typically mixed in the imports
field in deno.json
and Deno takes care of only downloading the needed dependenciesthank you @marvinh. , so what the
--dev
flag is used for https://docs.deno.com/runtime/reference/cli/add/#options-dev ?It's used for when you're using
package.json
alongside deno.json
. When the --dev
flag is specified it will install npm dependencies it into the devDependencies
field of package.json
. That flag does nothing if you don't have a package.json
and is not needed if you're developing straight in Denothank you @marvinh.