intoli / user-agents

A JavaScript library for generating random user agents with data that's updated daily.
Other
981 stars 51 forks source link

Fix module exports #36

Closed sangaline closed 3 years ago

sangaline commented 3 years ago

Following Kill CommonJS default export behaviour #2212, babel always exports a default to exports.default. This broke the module.exports = UserAgent; behavior after upgrading the babel version. This PR adds babel-plugin-add-module-exports so that imports should now work as import UserAgent from 'user-agents' and const UserAgent = require('user-agents').