Moved common code to retrieve distDir to common.js