added isJavaScriptFile() helper method
now assumes that dest is a folder if it is not a JavaScript file. (and neither of outDir nor out are specified)