Following the Angular 2 style guideline 04-10 Create and Import Barrels can be challenging, as it may lead to unexpected file loading issues. When running my app, I noticed that Angular attempts to load a non-existent file named "my-component-name-here.js". To demonstrate this problem, I made changes to the Angular 2 sample app, incorporating a barrel file which resulted in a 404 error.
To address this issue, I organized the heroes component files into a separate folder named heroes. In this folder, I created a new file called heroes/index.ts:
export * from './heroes/heroes.component';
Subsequently, I modified the import statement in app.component.ts to:
import { HeroesComponent } from './heroes';
Upon attempting to load the app, an error was observed in the developer console:
Error: Error: XHR error (404 Not Found) loading app/heroes.ts(…)
A Plunkr demonstrating this issue is available here: http://plnkr.co/edit/YXY0PwuFot1g1s6qTqDt?p=preview
This problem seems to be related to SystemJS, but my understanding of it is limited. Any assistance in resolving this would be greatly appreciated. Thank you in advance!