Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly Packaging node_modules In Distribution #3906

Closed
GEMISIS opened this issue Jan 9, 2023 · 4 comments
Closed

Incorrectly Packaging node_modules In Distribution #3906

GEMISIS opened this issue Jan 9, 2023 · 4 comments
Labels
bug This issue is a bug.

Comments

@GEMISIS
Copy link

GEMISIS commented Jan 9, 2023

Describe the bug

When packaging my distribution, JSII is bundling the node_modules directory as well for the javascript distribution. This drastically balloons up the size, and there is no way to prevent it from doing so.

Expected Behavior

Don't bundle the node_modules directory with js distributions.

Current Behavior

It's bundling the node_modules directory with js distributions.

Reproduction Steps

Just do a normal build with whatever dependencies you ahve.

Possible Solution

No response

Additional Information/Context

No response

SDK version used

1.72.0

Environment details (OS name and version, etc.)

Mac OS X (Intel)

@GEMISIS GEMISIS added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2023
@mrgrain mrgrain added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 19, 2024
@mrgrain
Copy link
Contributor

mrgrain commented Feb 19, 2024

Hi @GEMISIS We will need some more information on this. JSII doesn't really package anything itself. jsii-pacmak is using npm pack under the hood. If node_modules are included in the created package, than something in the configuration is likely wrong. What is your .npmignore and files in package.json look like? What version of npm are you using?

@GEMISIS
Copy link
Author

GEMISIS commented Feb 19, 2024

The project in question where this is occuring can be found at https://github.com/GEMISIS/discord-bot-cdk-construct

It sounds like maybe npm pack has a bug? Or are you saying I should add node_modules to my .npmignore?

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Feb 20, 2024
@mrgrain
Copy link
Contributor

mrgrain commented Feb 20, 2024

You have a number of bundled dependencies: https://github.com/GEMISIS/discord-bot-cdk-construct/blob/main/package.json#L98-L106

It is expected that node_modules will be included in the produced artifact. Are you seeing any that you think should not be bundled?

@mrgrain mrgrain closed this as completed May 15, 2024
Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants