Safe export with main.js