polyfill-exports

0.4.0-beta.2 • Public • Published

polyfill-exports

Create a script to polyfill requiring ES package "exports" for nodejs 12 below.

Install

$ npm install -D polyfill-exports
# or
$ yarn add --dev polyfill-exports

Usage

Build the polyfill script:

$ npx polyfill-exports
# or
$ yarn run polyfill-exports

then add the script into package.json "files" and "postinstall" hook.

// your package.json
{
  ...,
  "exports": {
    "foo": "./lib/foo.js"
  },
  "script": {
    "postinstall": "node ./polyfill-exports.js"
  },
  "files": [
    ...,
    "polyfill-exports.js"
  ]
  ...
}

Delete polyfill files

$ npx polyfill-exports --delete
# or
$ yarn run polyfill-exports --delete

Versions

Current Tags

Version History

Package Sidebar

Install

npm i polyfill-exports

Weekly Downloads

2

Version

0.4.0-beta.2

License

MIT

Unpacked Size

18.8 kB

Total Files

9

Last publish

Collaborators

  • lrills