compatible with commonjs

Hey @kenhkan, this seems to work in my local project, please verify this work :cherries: