Live data from Hacker News

Shrinking my static site

hampton.pw

11–20 of 107 posts

Re: Shrinking my static site

#11
post #4

Earlier quoted context omitted.

How is that any different from build tooling for any other language? On my system, gcc with a bunch of commonly used dependencies requires just about the same space (and it's a full Linux system, not a trimmed down container).

> How is that any different from build tooling for any other language? On the one hand yes, on the other hand it's a large amount of crap just to build a static site. `npm install @11ty/eleventy` pulls 600 packages and yields a 100MB node_modules folder. Even Sphinx (whose scope goes way beyond static site generation) "only" pulls in about 75MB worth of stuff (a third of that being Babel) over two dozen dependencies…

To be fair, you still have a tree shaking and minification step that would reduce this quite a bit.

Re: Shrinking my static site

#13

Why even have a docker image for a static site? If the site has to be built like this one then just put the output of the build process behind some webserver. We were doing this back in the 90s and didn't have to write blog posts about how not to make your site 400MB.

> just put the output of the build process behind some webserver.

That's what this is doing.

You are skipping over two other parts which are installing and setting up nginx / similar and creating a process for the build itself. This ties the three together.

Re: Shrinking my static site

#16
post #10

Earlier quoted context omitted.

How is that any different from build tooling for any other language? On my system, gcc with a bunch of commonly used dependencies requires just about the same space (and it's a full Linux system, not a trimmed down container).

Obvious: Because GCC is a compiler not a runtime. Node is a runtime. You (usually) don't ship the compiler. Less obvious: You probably wont need Nginx, especially for small static files, in languages where the native servers are fast enough (e.g. http.FileServer)

For a static site Node is a compiler not a runtime dependency.

Re: Shrinking my static site

#18
post #10

Earlier quoted context omitted.

How is that any different from build tooling for any other language? On my system, gcc with a bunch of commonly used dependencies requires just about the same space (and it's a full Linux system, not a trimmed down container).

Obvious: Because GCC is a compiler not a runtime. Node is a runtime. You (usually) don't ship the compiler. Less obvious: You probably wont need Nginx, especially for small static files, in languages where the native servers are fast enough (e.g. http.FileServer)

Node is a compiler too..
Post reply on HN