gobinaries | Golang binaries compiled on-demand for your system
kandi X-RAY | gobinaries Summary
kandi X-RAY | gobinaries Summary
Golang binaries compiled on-demand for your system
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gobinaries
gobinaries Key Features
gobinaries Examples and Code Snippets
Community Discussions
Trending Discussions on gobinaries
QUESTION
This is my first heroku app... and I see that my heroku slug size is 296MB... getting uncomfortably close to the fast 300MB boot time.
This is a puppeteer app with ejs, path, and express installed. I have a bunch of static files but they don't seem to be taking up majority of the space..
I would really appreciate help with this!
Edit: My package.json looks like this now (don't see how I could really trim down my node_modules - in fact, I wanted to add more dependencies as I further develop my app):
...ANSWER
Answered 2020-Nov-15 at 02:01After all the talk in the comments, I realized one thing: you can't delete folders in Heroku dynos! And you probably wouldn't want to anyways... Those folders look important (remember: Heroku dynos are usually mini-linux OSes, so that .apt
folder probably contains some of those mini-linux OS files). And of course, those .apt
and .heroku
folders probably don't add to your slug size. Sorry for that wild goose chase.
So? Let's reduce the sizes of stuff that actually matter.
Number one: reduce yournode_modules
size.
Since your node_modules
folder is the biggest folder that you could control, let's start there. We'll be following this article. I'll be modifying some instructions so that they work with Heroku.
- Reduce the number of dependencies: This may sound like a no-brainer, but it helps a lot. Think about the packages you install. Do you really need them? And if you do, is there a more lightweight package somewhere out there that you could use instead? Example:
A lot of times I see people installing Jest just for simple unit tests (about 460+ dependencies, +/-60MB) when there are smaller libs that will do exactly the same (Mocha – 115 dependencies, 12MB). 2. Remove unnecessary files: Besides the usual installed when you install a package (
.js
files, etc.), there's also a lot of... unneeded junk included (README
s,CHANGELOG
s, source files...). Because you can't remove those files manually (and who wants to), you need to use an automated tool and Heroku build scripts. Here's an example (remove the comments when you put this in yourpackage.json
).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gobinaries
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page