If you try to build one typescript file with the luaBundle option, all of the code in that file executes twice. The issue goes away as soon as you import or export anything.