Improved _generate_minified function to only minify if file does not already exist.