How to migrate a existing angular/react project into AEM

120 views Asked by At

So i made a very simple project in react with a few components on it and i want to know if there's a way to migrate it to AEM. Is it possible or the only way to do this is setting up a new project in AEM and then create everything from the start?

1

There are 1 answers

0
Rene van den Berg On

You don't need to create everything from scratch. AEM can run whatever html/css/js code you give it.

You can create a new AEM component and put the root element of your Angular/React app in there: <div id="my-app"></div>.
Then, create a new client-library and put your JS code in it.

That is a way to get your app to run in AEM. However, this implies that your JS code has already been build with something like Webpack. If you want the Webpack build step to be a part of your AEM build as well you will need to add that to the Webpack config in the ui.frontend folder of AEM.