Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't think of Node as a web server, that's what I'm guessing your understanding of it is. Think of it as a copy of JS that is available on your machine.

NPM is a package manager for you guessed it, Node. You use it to install dependencies, whatever those might be for your situation.

I will ignore Bower.

Grunt is a task runner, say you have a task like minifying javascript files. Grunt runs this task for you. Or CSS preprocessing, any task, it'll run it. There are other things in this space too. Grunt, gulp, webpack, browserify, etc.

The pieces aren't that hard to understand, you just have to read what they do.

Sure you can stick a JS file in an HTML file and you're good, but when you start building more complex apps where you need common code in parts, specific code in others, this becomes ridiculous to do by hand, that's why we have build tools.



I might be daft but I honestly don't even understand what "build" is in the context of a language that isn't compiled. Is it copying files to an output location together with dependencies and possibly including some transformations (minify etc)?


"Is it copying files to an output location together with dependencies and possibly including some transformations (minify etc)?".

That, and also other things, like compiling ES7+ JavaScript code to ES5 to run in most browsers, or compiling a typed JavaScript file to non-typed (e.g. TypeScript to JavaScript). You can also compile files to .css and .html from different languages like pug and scss. There's a large amount of various transformations that can be applied to web files.


Ah. There is tons of stuff that really is compiled and the compiled output is css, html, and ES, and the compiled inputs are TS, scss et.al. I get it.


Transpiling is I think the _in_ word.


Yep, that's it.

Some of the other build steps we run: checking to ensure all dependencies are installed, concatenation, minification, obfuscation, code splitting, template compilation, copying files, deleting files, resolving require/bundling whatever that is called.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: