angular-cli is great because it basically does a ton of boilerplate stuff for you. When you want to create a new project, you just tell angular-cli to make you one and BOOM – you’re good to start programming. Its one of the reasons that I think I still prefer Angular over React or Vue or any of the other myriad of javascript frameworks… I know how to write Angular, and I would rather just start going than spend a bunch of time setting up my tools.
However, sometimes its not so easy… like when you want to do something that isn’t standard. I recently needed to copy a javascript file from the node_modules folder in to the wwwroot folder. I had created a standalone html file that needed a single library (SignalR) that would be shown via a pop-up. (I didn’t want the entire bulk of my Angular project to be in the pop-up, because you might end up popping up several of these windows at the same time).
I set about trying to figure out how to do this, and it took me an inordinate amount of time, so I figured I’d write it down.
The trick
is to make an object in the assets array following the asset configuration guidlines:
Kind of goes without saying but:
glob tells that files to copy
input gives you the input directory
output gives you the output directory