So I have a node project with a javascript file that contains a huge function that has alot of code. I was wondering if I could breakup this standard javascript function, into seperate functions and have grunt "compile them" into 1 function in 1 file. Is this even possible?
Yes it is completely posible... There are various ways of doing it..
With grunt: Try this contrib module. It is very easy to use and all the documentation is detailed in the link.
Without grunt: On the other hand if you want to try something without grunt you could try the selectizer module. If it fits your needs I think that this is a much better option given that you can arrenge your dependecies explicitly using the requireJs syntax and then compile all the modules into one single clean file. That makes your code easier to maintain in the mid-term/long-term. Also you could select which modules to build and which not, so in the final build there are going to be only the module you selected and their dependencies and no more.