This function reads the file contents and replaces any script and stylesheet names within the file with the minified ones. It simply replaces existing names and appends a .min and saves the the content back to the file.