generation of mkws.js must be atomar