Removes error caused by having a data-main script in a JS block
Writes processed file to options.basedir