Search code examples
compilationangular5angular-clitranspiler

Transpile and Compilation using Angular-CLI


I'm reading the book Angular 5 Projects and have come across this sentence:

The Angular CLI uses Webpack to transpile, compile, and deploy project code.

Transpile and compilation are given in the following link

The transpile is from TypeScript to JavaScript.

What language does angular-cli compile the JavaScript code to? And is angular-cli doing both: transpile and compilation?

Thanks for the help!


Solution

  • Typescript must be transpiled into JavaScript using the tsc compiler, which requires some configuration.

    Yes, it's doing both. When working in Angular you will using TypeScript to code in files designated as your-component.ts with the 'ts' signifying that it's a TypeScript file. Angular then takes these files and does the transpiling (conversion to another language). In this case that would be TypeScript to Javascript. Once this is done Angular uses these now created JavaScript files to communicate to the browser with.