Broccoli Merge Trees Error
I recently updated some code and config files in an older Angular 2 CLI project. I made a simple change and then executed the usual ng build. I was greeted with a Broccoli merge-trees compilation error. This should not happen with newly initialized projects using the latest CLI, but you may experience it with an update to an older project. After some online research, it seems a simple one-line fix in the angular2-app.js file gets you past the problem in the short term. This file is located at <project_name>/node_modules/angular-cli/lib/broccoli.
The line to modify should be at or near line 170. Refer to the image, below.
It’s a hack, but should get you up and running again without having to re-init a new project.
Technology … can’t live with it … can’t make a living without it.