Bit: No compiler for Angular component

Created on 9 Apr 2019  路  1Comment  路  Source: teambit/bit

I tested uploading my angular component to bit.dev with bit add (component.html, component.css, component.ts), bit tag, bit export. I got it uploaded and the code would be shown but the component would not load on the site. I looked for a compiler working for this type of code but could not find any. How do I get this working?

arebit.dev areecosystem typquestion

Most helpful comment

Hi, there are some limitations for reusing Angular components.
At the moment it is impossible to build/test an Angular component without the context of a project. This is a limitation forced by the Angular compiler. Only the future release of Ivy will fix it.
We have discussed it with the Angular team, and the workaround that they found is not to use a compiler at all.
You can track and share the source files of the components, and import them to other projects, and let the consuming project handle the compilation process of the code, as part of the project's build.
It should also work if you use npm i for uncompiled components in Bit, as ng compiles code found in the node_modules dir.

As for rendering support - we are working to extend the playground support for additional frameworks. Angular is next in line (alongside Vue). I hope it will be done and shipped in the next few weeks.

>All comments

Hi, there are some limitations for reusing Angular components.
At the moment it is impossible to build/test an Angular component without the context of a project. This is a limitation forced by the Angular compiler. Only the future release of Ivy will fix it.
We have discussed it with the Angular team, and the workaround that they found is not to use a compiler at all.
You can track and share the source files of the components, and import them to other projects, and let the consuming project handle the compilation process of the code, as part of the project's build.
It should also work if you use npm i for uncompiled components in Bit, as ng compiles code found in the node_modules dir.

As for rendering support - we are working to extend the playground support for additional frameworks. Angular is next in line (alongside Vue). I hope it will be done and shipped in the next few weeks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kegi picture kegi  路  4Comments

lubomir-chatoryiskyi picture lubomir-chatoryiskyi  路  3Comments

KutnerUri picture KutnerUri  路  3Comments

manuel-minniti picture manuel-minniti  路  3Comments

KutnerBitsrc picture KutnerBitsrc  路  4Comments