Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

object-assign-native

0.1.0 • Public • Published

object-assign-native

Some libraries (e.g. React) don't want to rely on the user polyfilling Object.assign and therefore use sindresorhus's ponyfill object-assign although all modern browser and nodejs versions support it flawlessly.

While not a noticeable in size for most apps it is still half a kb minified and gziped that isn't necessary. Luckily most bundlers allow for modules to be replaced at build time with another one.

Webpack

When using webpack just add the following lines to your config:

const webpack = require("webpack");
// ...
  plugins: [
    new webpack.NormalModuleReplacementPlugin(
      /^object-assign/,
      "object-assign-native"
    )
  ]
// ...

Install

npm i object-assign-native

DownloadsWeekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

1.14 kB

Total Files

3

Last publish

Collaborators

  • avatar