Build Tool vs Task Runner
People think a task runner is a build tool, and they are not the same. A task runner just gives a short name to a command, like build or test. A build tool knows which files each step needs. It runs the steps in order and skips the ones that are already done.
Build Tool
A tool that runs the steps that turn your code into a whole app.
A build tool is a program that turns source code into a finished program by running the steps for you. You write the steps once in a file, like a Makefile or a pom.xml. The tool then compiles, tests and packs the code in the right order. Good ones skip any step whose files did not change. Make, Maven and Gradle are well known ones.
Task Runner
A tool that runs a project's jobs by name, like npm run build.
A task runner is a tool that runs named jobs for a project with one short command. Each task is a name tied to the real commands, like build, test or lint. In a JavaScript project, the tasks live in the scripts part of package.json. You then type npm run build, not the long command behind it. So everyone on the team runs each job the same way.
In one line
- Build Tool
- A tool that runs the steps that turn your code into a whole app.
- Task Runner
- A tool that runs a project's jobs by name, like npm run build.