writeToFile writes content to a file reachable from context.outPaths.hostRoot for exporting
context.outPaths.hostRoot