compile the file to be a javascript template function