refactor(global to cjs): extract createRequireDeclaration to utilities module