`yarn build` do not include dependencies in generated bundle
chavda-bhavik opened this issue · comments
Current Behavior
When I run yarn build
command, packge.json dependencies
are not added to the bundle.
Expected behavior
package.json dependencies
should be included to the bundle.
Suggested solution(s)
Additional context
I'm building a NodeJS package and it can be found here.
Your environment
System:
OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
CPU: (4) x64 Intel(R) Core(TM) i3-1005G1 CPU @ 1.20GHz
Memory: 6.12 GB / 11.44 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 16.15.1 - ~/.nvm/versions/node/v16.15.1/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v16.15.1/bin/yarn
npm: 8.15.1 - ~/.nvm/versions/node/v16.15.1/bin/npm
Browsers:
Brave Browser: 103.1.41.100
Chrome: 103.0.5060.134
npmPackages:
dts-cli: ^1.5.2 => 1.5.2
typescript: ^4.7.4 => 4.7.4
npmGlobalPackages:
typescript: 4.7.4
it's expected. users will install your lib's dependencies, so it's no need to bundle them.
Any way to include lib's dependencies in bundle @aladdin-add?
maybe you can try moving them to devDependencies
. but TBH, I'm not very sure.
I tested and found that npm installs dependencies
if the package has package.json
and package.json
has dependencies
specified. Still, I will verify it and close this issue.
Closing this issue because I tested that if the package has package.json
and package.json
has dependencies
specified, npm installs that dependencies
automatically.