4 ms·
"Another nice thing: the node_modules folder for this Hello World Svelte app totals only 29MB and 242 packages." How is it nice that you have almost 30MB of co
by Zelphyr 7y ago
"Another nice thing: the node_modules folder for this Hello World Svelte app totals only 29MB and 242 packages."
How is it nice that you have almost 30MB of code for something that prints "Hello World"?
EDIT: For what it's worth, I don't fault Svelte for this necessarily. This is indicative of NPM bloat which is becoming rampant in my opinion.
- bbmario 7y agoIs it 29MB for production dependencies, or dev and prod?
- wishinghand 7y agoJust dev. Production size is minuscule.
- jacobedawson 7y agoTo be fair, the Svelte bundle.js that you would actually serve to a browser is only 2.3kb. The 25mb is what the dev's computer has to store in its node_modules. "Another nice thing: the node_modules folder for this Hello World Svelte app totals only 29MB and 242 packages. Compare that to 204MB and 1017 packages for a fresh Create React App project."
- Zelphyr 7y agoA somewhat apples-to-oranges comparison I know but; 277B: <!DOCTYPE html> <html lang="en"> <head> <title>Test</title> </head> <body> <div id="howdy"></div> <script type="text/javascript"> document.addEventListener('DOMContentLoaded', () => document.getElementById('howdy').innerHTML = 'Hello world!') </script> </body> </html>
- lioeters 7y agoOmitting html, head, and body tags is allowed by HTML specs, and the script tag's default type is "text/javascript". So it could be further simplified to: <title>Test</title> <div id="howdy"></div> <script> document.addEventListener('DOMContentLoaded', () => document.getElementById('howdy').innerHTML = 'Hello world!' ) </script> Edit: formatting
- esotericn 7y agoLOL. I am actually laughing here at this comment. 30 bloody meg. Never mind ageism in tech, this sort of thing will give me a heart attack before I'm halfway through my career. :D
- jf22 7y agoIf you think of js bundle size as a percentage of average hard drive space or compare to a ratio of broadband speeds then 30 megs doesn't seem so bad.
- Zelphyr 7y agoStill, seriously? 30MB to print "Hello, World"? I can drive a Hummer H3 the block away to the 7-11 but wouldn't it be better if I at least try to ride my bike up there whenever possible?
- robertoandred 7y agoWhat in that app's node_modules folder do you consider to be necessary bloat?