source: imaps-frontend/node_modules/babel-plugin-polyfill-corejs3/README.md

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.9 KB
Line 
1# babel-plugin-polyfill-corejs3
2
3## Install
4
5Using npm:
6
7```sh
8npm install --save-dev babel-plugin-polyfill-corejs3
9```
10
11or using yarn:
12
13```sh
14yarn add babel-plugin-polyfill-corejs3 --dev
15```
16
17## Usage
18
19Add this plugin to your Babel configuration:
20
21```json
22{
23 "plugins": [["polyfill-corejs3", { "method": "usage-global", "version": "3.20" }]]
24}
25```
26
27This package supports the `usage-pure`, `usage-global`, and `entry-global` methods.
28When `entry-global` is used, it replaces imports to `core-js`.
29
30## Options
31
32See [here](../../docs/usage.md#options) for a list of options supported by every polyfill provider.
33
34### `version`
35
36`string`, defaults to `"3.0"`.
37
38This option only has an effect when used alongside `"method": "usage-global"` or `"method": "usage-pure"`. It is recommended to specify the minor version you are using as `core-js@3.0` may not include polyfills for the latest features. If you are bundling an app, you can provide the version directly from your node modules:
39
40```js
41{
42 plugins: [
43 ["polyfill-corejs3", {
44 "method": "usage-pure",
45 // use `core-js/package.json` if you are using `usage-global`
46 "version": require("core-js-pure/package.json").version
47 }]
48 ]
49}
50```
51
52If you are a library author, specify a reasonably modern `core-js` version in your
53`package.json` and provide the plugin the minimal supported version.
54
55```json
56{
57 "dependencies": {
58 "core-js": "^3.20.0"
59 }
60}
61```
62```js
63{
64 plugins: [
65 ["polyfill-corejs3", {
66 "method": "usage-global",
67 // improvise if you have more complicated version spec, e.g. > 3.1.4
68 "version": require("./package.json").dependencies["core-js"]
69 }]
70 ]
71}
72```
73
74### `proposals`
75
76`boolean`, defaults to `false`.
77
78This option only has an effect when used alongside `"method": "usage-global"` or `"method": "usage-pure"`. When `proposals` are `true`, any ES proposal supported by core-js will be polyfilled as well.
Note: See TracBrowser for help on using the repository browser.