Yes. You can checkout asset-smasher lib for this. We are doing the same in our project which is a migration of rails project.
We use something like application.js.ejs which is converted to application.js after asset-smashing.
You can specify custom helper functions like ImageUrl etc while smashing.