When I run the offline compiler ngc on an Angular 2 RC5 vanilla project created by angular-cli, it does nothing.
Here's what I did
Setup:
ng new my-project
cd my-project
npm install @angular/compiler-cli typescript@next @angular/platform-server @angular/compiler
Running the compiler
./node_modules/.bin/ngc -p ./src
The command output nothing and I did not see it generate a min.ngfactory.ts
What am I missing?
By default, aot is set to true for new CLI applications. See the CLI command reference and Building and serving Angular apps for more information.
The Ahead of time compiler detects template error earlier. It detects and reports template binding errors during the build steps before users can see them. AOT provides better security. It compiles HTML components and templates into JavaScript files long before they are served into the client display.
The Angular Compiler (which we call ngc ) is the tool used to compile Angular applications and libraries. ngc is built on the TypeScript compiler (called tsc ) and extends the process of compiling TypeScript code to add additional code generation related to Angular's capabilities.
ng-build: Compiles the application and produces the build files to an external folder. The name of the output folder is decided by the value of outputPath property present in the 'build' section in 'angular. json' file. As a result this output folder generated at the end can be used to deploy in any external server.
I encountered the same issue and I solved this by down grade typescript to 2.0.2.
I found this on: https://github.com/angular/angular/issues/11689
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With