Coder Social home page Coder Social logo

Comments (7)

agutoli avatar agutoli commented on August 19, 2024 1

Done! Now it's setting excludeDevDependencies = false automatically.

Thank you for the suggestion!

https://github.com/agutoli/serverless-layers/blob/master/src/index.js#L166

from serverless-layers.

agutoli avatar agutoli commented on August 19, 2024

Hi, @enapupe. I appreciate your message.

So, yeah. I can not use "the existing node_modules" to create AWS lambda layers, that's because it has dev dependencies as well (which is not necessary to be uploaded). So I really need to "ignore" existing node_modules, that's is correct and expected.

Therefore, customInstallationCommand is necessary for some cases who's someone needs to install a "production" package and your environment uses a proxy or a custom install command (again, this plugin ignores your node_modules).

About config bellow, it's because you can ignore your existing node_modules which will not be used by serverless-layers when packing your project, so your package should be drastically smaller if compared when you remove this config:

package:
  individually: false
  exclude:
    - node_modules/**
  excludeDevDependencies: true

Stil about "I was able to save 10+ seconds setting this flag to false", I will investigate better ". Thanks again.

from serverless-layers.

enapupe avatar enapupe commented on August 19, 2024

Sorry if I wasn't clear enough.
My assumption is: if the layer is being generated by customInstallationCommand and node_modules is package ignored, there is no point in spending time separating what's devDeps and what not, which seems to be what that flag is doing.

FWIW I have set the flag to false and it did not affect uploaded files, while it saved package time.

Hope that clears my question. Thanks for your time have a good weekend.

from serverless-layers.

agutoli avatar agutoli commented on August 19, 2024

Oh.. ok, yes. You probably right. I will remove it from README. This excludeDevDependencies is a good option when is not using serverless-layers.

thanks for raising that point!

from serverless-layers.

enapupe avatar enapupe commented on August 19, 2024

I see you have just changed how this was working and thus removed it from the readme, which makes sense.
However, it seems you should automatically set excludeDevDependencies: false as it default to true and it's pointless - as discussed

from serverless-layers.

agutoli avatar agutoli commented on August 19, 2024

Cool. I can do that. Just add one line at:
https://github.com/agutoli/serverless-layers/blob/master/src/index.js#L161

from serverless-layers.

agutoli avatar agutoli commented on August 19, 2024

Thanks for your contribution.

from serverless-layers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.