generator-angular2-typescript icon indicating copy to clipboard operation
generator-angular2-typescript copied to clipboard

Use the offline compiler for Webpack

Open Meligy opened this issue 9 years ago • 2 comments

I discovered this gem the other day, ngc-loader, by one of the Webpack core team members.

Would it make sense to try to add it to the project? I asked the guy on twitter and he said that the AngularClass starter uses it (I couldn't see where), and he said a few other ones but didn't specify.

I realise you already try to do something related to precompilation, seeing some precompile property in the AppComponent's @Component.

Would that be a good idea, or you rather wait for Application Modules or something?

I think this one is usable now though. Still sharpening my own Webpack skills so not sure of all the details.

Meligy avatar Jul 10 '16 01:07 Meligy

I agree that would be nice feature. Angular 2 offline template compiler is very useful. I'll need some time to study more or may be wait for the full release. I'll get back to it ASAP. I am also new to webpack :)

And the precompile property you see in AppComponent's @Component defines the components that should be precompiled as well when this AppComponent is defined. The new angular router needs the registered components for the router to be precompiled. Otherwise It will give a warning message.

https://github.com/angular/angular/blob/6c5b653593eff19c5b9342b2cf0195aca49379cb/modules/%40angular/core/src/metadata/directives.ts#L968

shibbir avatar Jul 10 '16 13:07 shibbir

  • 1 . It will be nice to have precompile in this generator

zmitry avatar Oct 08 '16 11:10 zmitry