diff --git a/.changeset/lazy-buttons-raise.md b/.changeset/lazy-buttons-raise.md deleted file mode 100644 index 8f62976..0000000 --- a/.changeset/lazy-buttons-raise.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'babel-plugin-un-cjs': minor ---- - -Handle edge case: instance methods of `Function.prototype`: - -If an imported binding _only_ is referenced using properties of `Function.prototype`, this suggests that the imported binding itself is probably a function instead of a namespace, so we create a default import instead of a namespace import. - -```js -var bind = require('function-bind') - -bind.call(Function.call, Object.prototype.hasOwnProperty) -``` - -to - -```js -import bind from 'function-bind' -bind.call(Function.call, Object.prototype.hasOwnProperty) -``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 22f707d..725397f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # babel-plugin-un-cjs +## 2.6.0 + +### Minor Changes + +- [`428d52a`](https://github.com/calebeby/babel-plugin-un-cjs/commit/428d52a249b1056177070fcffaf3dfb0a1a64833) Thanks [@calebeby](https://github.com/calebeby)! - Handle edge case: instance methods of `Function.prototype`: + + If an imported binding _only_ is referenced using properties of `Function.prototype`, this suggests that the imported binding itself is probably a function instead of a namespace, so we create a default import instead of a namespace import. + + ```js + var bind = require('function-bind') + + bind.call(Function.call, Object.prototype.hasOwnProperty) + ``` + + to + + ```js + import bind from 'function-bind' + bind.call(Function.call, Object.prototype.hasOwnProperty) + ``` + ## 2.5.0 ### Minor Changes diff --git a/package.json b/package.json index f78b236..28cea75 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-un-cjs", - "version": "2.5.0", + "version": "2.6.0", "repository": "calebeby/babel-plugin-un-cjs", "description": "", "main": "./dist/index.js",