I have NPM packages referenced in CloudCode tasks that I do not need. Is there overhead with leaving them there, or can/should I remove them in yarn.lock? That platform generated file has a comment that it should not be directly edited, but it is pretty easy to see what needs to go, if I do remove it.
There is an initial overhead in the deployment phase with no major effect thereafter (during runtime).
To remove the unused packages do the following:
- Open the
package.json
file of the task - Locate the unused package in the
dependencies
node - Remove the line with the package name and version e.g. Remove
"moment-timezone": "^0.5.31"
and make sure the formatting of the JSON is correct - Run the
Update yarn.lock
action on the CloudCode task. This action can be found by right-clicking on the task
1 Like
That worked like a charm, thanks Mike
1 Like