Generate the new module content before emptying the existing module file