Incorrectly Packaging node_modules In Distribution
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)
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?
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?
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?
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.