DenoDDeno
Powered by
AgowanA
Deno•14mo ago•
14 replies
Agowan

deno install Omit/exclude dev dependencies from package.json

I have a sveltekit project that I want to convert to using deno 2.0 (currently using 2.1.9). I can run
deno build
deno build
(to pre render my sveltekit app) and
cd build && deno index.js
cd build && deno index.js
works like a charm. However, I also have some api routes that use npm packages.
Everything works fine when running locally.
But when I build my Docker image, I would like to install only the needed dependencies (those under dependencies). I don’t need the
devDependencies
devDependencies
, such as lints and types. In npm, I would use
--omit=dev
--omit=dev
(I believe Bun has a similar flag).

Is there a way to exclude
devDependencies
devDependencies
when running
deno install
deno install


I have checked the manual: https://docs.deno.com/runtime/reference/cli/install/, but I couldn't find anything about excluding
deDependencies
deDependencies
.
The closest thing I found was this: https://docs.deno.com/runtime/reference/cli/install/#options-entrypoint, but it’s unclear which file I should specify for sveltekit.

Does anyone know if there is a way to omit
devDependencies
devDependencies
when running
deno install
deno install
or should I use
--entrypoint=file1.file2
--entrypoint=file1.file2
, if so which file should I select? Or is there a better way to handle this?
Or is there a better way to handle this?
Deno
`deno install`
In-depth documentation, guides, and reference materials for building secure, high-performance JavaScript and TypeScript applications with Deno
`deno install`
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

npm package command cannot read deno.json dependencies
DiegoDDiego / help
16mo ago
🦕 Deno adds to package.json instead of deno.jsonc.
RolloRRollo / help
6mo ago
GitHub imports from package.json in Deno
phocks_testPphocks_test / help
16mo ago
Converting package.json into deno.json
KotkoroidKKotkoroid / help
16mo ago