Skip to content

.build/node_modules symlink vs. npm #45

@stesie

Description

@stesie

Hey,

I've just recently started trying out serverless framework and this plugin just today. So sorry in case things are a bit inaccurate :)

My problem is that, together with the typescript-plugin, the core's package plugin fails to properly exclude development dependencies from the build/package. This way even a simple "hello world" function has a footprint of roughly 15MB, where it should be just about 2 kB.

Problem seems to be, that package plugin just calls npm ls --dev=true ... and npm ls --prod=true ... and diffs the output of those two. With this plugin these shell calls are done from the .build folder, yet npm ls --dev=true ... fails to properly list all the dependencies as it stumbles over the symlinking.
Seems like it doesn't expect deduped/flattened dir structure then.

Replacing both symlinkSync calls by copySync immediately fixes the problem so :)
... yet I'm unsure if there's a better way to do that ...

regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions