Read more

Converting ES6 to ES5 on the command line

Henning Koch
March 23, 2021Software engineer at makandra GmbH

I use the TypeScript compiler for this, since its output is more minimal than Babel's.

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

The following will transpile all src/*.js files into a file build.js:

npm install typescript
npx tsc src/*.js --target ES5 --allowJs --outFile build.js

The output will only transpile ES6 syntax. It will not include any polyfills for missing APIs.

Posted by Henning Koch to makandra dev (2021-03-23 15:23)