Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

450
Visualizações
How do I transpile TypeScript to ES6?

Basically I need to be able to write TypeScript code in my IDE (this introduces great ease to development), compile it to ES6 and then apply babel.js (as all browsers doesn't support most ES6) to get the resulting ES5 scripts.

Is this possible? How can I achieve this?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Yes.

You can target TypeScript compiler to ES6.

For example add this to your command line args:

--target es6
over 4 years ago · Santiago Trujillo Relatório

0

Yes, You can.

Either by adding --target es2015, or by adding target to Your tsconfig.json:

{
  "compilerOptions": {
    "target": "es2015"
  }
}

Supported options for target are:

  • "ES3" (default)
  • "ES5"
  • "ES6"/"ES2015"
  • "ES2016"
  • "ES2017"
  • "ESNext"

There are a lot of more config options. You can explore them here: Compiler options

Some options are only allowed in tsconfig.json, and not through command-line switches.

over 4 years ago · Santiago Trujillo Relatório

0

You can use typescript to write pure ES6 and then transpile to ES3 or ES5. Since typescript is ES6 plus goodies.

See it as using Less to write your css, you can write pure CSS in a less file and it will compile just fine.

For typescript 1.8 language spec:

TypeScript is a syntactic sugar for JavaScript. TypeScript syntax is a superset of ECMAScript 2015 (ES2015) syntax. Every JavaScript program is also a TypeScript program.

TypeScript syntax includes all features of ECMAScript 2015, including classes and modules, and provides the ability to translate these features into ECMAScript 3 or 5 compliant code.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda