I'm giving a try to Angular 2 RC4 compiler-cli to get project components compiled offline and I'm running into some problems in here.
Just for a notice, I am using directions that can be found in here: http://blog.mgechev.com/2016/06/26/tree-shaking-angular2-production-build-rollup-javascript/
So, my layout is that we're having here a several private npm packages which all have been exported for es5 target with es2015 version of that package nested in esm folder and jsnext:main tag in place that points to esm/core.js.
As that is done I'm building a project that is successfully loading those external modules and creates an application, that actually runs with no problems. In order to make it even better I'd like to apply all the techniques described in web post mentioned above.
In order to do all of that I've created a tsconfig file that sets target and module to es2015 and run:
node_modules/.bin/ngc -p .
And I'm doing this on linux build server.
Problem with all this setup is that for some reason some of components described in external packages cannot be properly parsed by ngc and I am getting:
Error: No Directive annotation found on *external component*
Error per each use of components located in core package.
So, can anyone point me to what's wrong with this setup and how can this be solved?
I would really like to see how bundle size would look like in final layout...
Also, I've noticed that some of examples use moduelId within @Component decorator but I've not seen any need for that, at least for now - could it be that that is a problem?
PS
If I ignore those errors and try to go on I see that all components which were including any of those external components producing errors, *.ngfactory.ts is generated as empty file.
PPS
Alternatively I could compile all the project from plain ts files. But then I run into a major problems on how to redirect all the references to my-local-core to some local folder with that package ts source files, as that module is already mapped to node-modules folder.