This Babel plugin replaces all `Object.assign` calls with a custom implementation specified via the `moduleSpecifier` option, importing the shim from an npm package. At version 2.0.0 (latest release, last updated in 2018), the plugin requires `@babel/core@^7.0.0` as a peer dependency. It is similar to `babel-plugin-transform-object-assign` but allows using an external package (e.g., `object-assign`) instead of Babel's internal `_extends` helper, reducing bundle size by avoiding per-file function declarations. However, the plugin is explicitly deprecated by the author: the original Chrome bug it addressed (V8 issue #4118) has been fixed since Chrome 49. The plugin remains functional but is discouraged for new projects; developers should consider native `Object.assign` or `babel-plugin-transform-object-assign` instead.
npm install babel-plugin-transform-replace-object-assignVerified import paths — ran on the pinned version, not inferred.
Install the plugin and a custom Object.assign implementation, configure Babel, and see how Object.assign is replaced with an import of the custom package.
Use native Object.assign (ES6) or babel-plugin-transform-object-assign if you need runtime shimming.
Ensure the specified package is in your dependencies and correct.
If you need to replace all uses, consider using a different approach like babel-plugin-transform-object-assign which uses the _extends helper.
If using Babel 6, stick with version 1.x of this plugin.
Consider alternatives like babel-plugin-transform-object-assign or @babel/plugin-transform-object-assign (Babel 7 core).
Run: npm install --save-dev babel-plugin-transform-replace-object-assign
Run: npm install --save object-assign
Ensure the moduleSpecifier package is in dependencies, not devDependencies.