Add module and variable exports to minify js

From #6236.