Revert "Revert "define config as CommonJS module""

This reverts commit 58db1d65cd466d5ac123465e34b744d25a5a698f.