I'm creating a SPA that have two parts. The landing page that is public and it's used to explain things about the project and to show up a login form. The other part of the application is not public and only registered users can access.
Each part of the site (Home & Dashboard) have different components. The problem I'm facing is that these component have different Javascript files that I already have bundled (home.js & dashboard.js). I've found in Internet different solutions but they do not look right to time.
Some details about the environment is that the application was scaffolded by Angular CLI so webpack is included, in case it makes easier the task.
I would like to know if there is a proper way to do it that meets Angular 2 Good practices.
Any help would be appreciated.