Giter Site home page Giter Site logo

Comments (5)

SamFarrington avatar SamFarrington commented on May 16, 2024 2

I was going down the route of bundledDependencies before I came across shrinkpack - my (very limited and quite possibly incorrect) understanding of bundledDependencies is that you may hit issues when working cross-platform - i.e. package on windows and deploy on linux as it's the node_modules folder that gets passed about and therefore that may contain platform-specific variations of dependencies.

For the record my current workaround for this issue is to manually archive the application using zip or tar rather than using npm pack and the unarchiving on the target server and running npm install in the extracted folder.

This workaround however just feels a little inelegant given the existence of npm pack

from shrinkpack.

lime avatar lime commented on May 16, 2024

I may be misunderstanding the use case, but it sounds like you are using shrinkpack inside a library that will be distributed for others to install using npm. Is that the case?

If so, then see #56 (comment) for an explanation of how this is not the intended use case for shrinkpack.

  • If you are working on a project which is the root of the tree of dependencies, use shrinkpack.
  • If you are working on a project which is itself an npm dependency of other projects, do not use shrinkpack – let downstream projects manage their own bundling.

Shrinkpack is not intended for use in packages published to the registry;

  • It's purpose is to add resilience against the registry being unavailable, so to do it within packages which are themselves hosted on that registry would not help.
  • The size of packages would grow if 1000s of them all bundled their dependencies, many of which would likely be duplicated.

Please correct me if I misunderstood what it is you're trying to do.

from shrinkpack.

SamFarrington avatar SamFarrington commented on May 16, 2024

I guess the use case I am encountering is the borderline of your comment above.

The use case is installing a node application on a (production) server with no external network access - i.e. no internet access and no git repo access.

Whilst it may not be the initial intended purpose of this project, this project fits the bill for that purpose pretty well.

The negatives you have mentioned do not apply to this use case as these distributables are used solely as self-contained applications, not provided to any registry to be further developed on/reused by.

from shrinkpack.

lime avatar lime commented on May 16, 2024

That's an interesting use case! And as you say, it's quite different from the "wrapping dependencies of a distributed library" situation.

I've never tried the packed application approach, so I'm probably unable to suggest anything useful.

Just out of curiosity though: are you using bundledDependencies or the normal dependencies in your app? I've always thought of bundledDependencies as being useful when packaging a full application, but maybe that still wouldn't work around the need for shrinkpack..?

from shrinkpack.

JamieMason avatar JamieMason commented on May 16, 2024

Sorry for the delay, I have updated the README to try and better explain how shrinkpack works currently and the kinds of situations it can be used. Please let me know if this does not help and more should be done, thanks.

from shrinkpack.

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.