Friday, 9 August 2019

Build angular element from existing project

We have an existing Angular 8 project which includes a bunch of common components (like custom datepickers, numeric inputs, ...). The project itself is a standard Angular-app.

We want to extract some of these components as Angular elements that they can be used in other Angular apps or even other projects which are not Angular related.

Is it possible to build the project in a way that only the code specific to a single Angular element is included in the generated JavaScript files?

What I need is something like this: ng build --element myDatePicker

This should generate all the JavaScript files for the myDatePicker-Element only with all the needed dependencies but without any other code from the project (like other components, modules, ...).

The whole app should still normally build when I use ng build.



from Build angular element from existing project

No comments:

Post a Comment