Add flag to disable launch dependency on node_modules - #755
Conversation
| suite("WithNodeModules", testNodeModules) | ||
|
|
||
| // nitro results in a a segfault on UBI builders using the extension for some reason... | ||
| if builder.BuilderName != "paketobuildpacks/builder-ubi8-buildpackless-base" && builder.BuilderName != "paketobuildpacks/ubi-9-builder-buildpackless" { |
There was a problem hiding this comment.
For the life of me, I couldn't undestand why the UBI extension caused grief for nitro... Enabling all the debug flags I could find didn't help either 😅
|
Hello, |
|
This solution does not handle the SBOM, practically the sbom is being generated from npm-install, and if later on you remove the node_modules the SBOM has the information of the removed node_modules, which practically should point to the node_modules under .output |
|
Seems like general rule for the buildpacks, is that dependencies should be on a layer and not on the workspace. the node_modules under the .output are on the workspace. The ideal would be to have them on a layer, this is useful especially for caching. |
|
In regards to testing, I think is not a good idea to include an application that is not being built correctly |
|
@ZephireNZ Any updates on the suggestions? |
Summary
Adds a flag
BP_NODE_LAUNCH_REQUIRES_MODULESto disable thelaunchdependncy onnode_moduleslayer, which is not required for bundled applications (eg Nuxt).Doing so means
npm-installbuildpack won't addsetup-symlinksstartup hook, which would otherwise fail if the folder was removed eg usingsource-removal.Fixes #736
Use Cases
Enables significant reduction in ouput image size, in conjunction with
paketo-buildpacks/source-removal. Refer to the error in above issue for what happens when you try to removenode_modulesfolder in the current state.Example from app I was working on - 493MB down to just 20MB by removing the workspace
node_modulesfolder.Checklist