Comments (5)
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.
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.
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.
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.
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)
- npm install fails after clone with some dependencies HOT 4
- shrinkpack 'is not recognized....' on Windows 10 HOT 3
- --compress flag issues on Windows HOT 6
- Update node & npm versions used in CI HOT 1
- Add support for npm5 HOT 86
- Handle local (file:) dependencies HOT 3
- after upgrate to ionic 3.. npm install failed, I cant create new app HOT 5
- Can't run shrinkpack after upgrading from npm v4.6.1 to v5.0.3 HOT 2
- NPM5 – npm ERR! aggregate error HOT 6
- UnhandledPromiseRejectionWarning: Unhandled promise rejection HOT 7
- Add Monorepo support
- Reference useful npm documentation in readme
- Add guides/recipes HOT 7
- Task: Ensure paths are always / in package lock
- npm 6 support (removed the `npm cache ls`) HOT 1
- Error: ! failed to read contents of npm cache HOT 1
- Integrities are concatenated HOT 5
- failed to read contents of npm cache
- A package+version tarball can be insufficient if platform libraries are needed HOT 2
- { "scripts": { "precompress": "{{ executes BEFORE the `compress` script }}", "compress": "{{ run command to compress files }}", "postcompress": "{{ executes AFTER `compress` script }}" } }
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shrinkpack.