Correct way to collect module imports for CommonJS