Use mkdirp to handle non-existent directories

If we don't use this, then we would need to copy the entire js directory to `public/assets-ugly`
to avoid `fs.writeFileSync` from failing on a non-existent path.