Skip to content

Commit

Permalink
use import in some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Apr 15, 2022
1 parent 0f3c603 commit 06c6a56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core-js-builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
For some cases could be useful to exclude some `core-js` features or generate a polyfill for target engines. This API helps conditionally include or exclude certain parts of [`core-js`](https://github.com/zloirock/core-js) and build for targets. `modules`, `exclude` and `targets` options are specified in [the `core-js-compat` format](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).

```js
const builder = require('core-js-builder');
import builder from 'core-js-builder';

const bundle = await builder({
modules: ['core-js/actual', 'esnext.reflect'], // entries / modules / namespaces, by default - all `core-js` modules
Expand Down
4 changes: 3 additions & 1 deletion packages/core-js-compat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
[`core-js-compat` package](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) contains data about the necessity of [`core-js`](https://github.com/zloirock/core-js) modules and API for getting a list of required core-js modules by browserslist query.

```js
import compat from 'core-js-compat';

const {
list, // array of required modules
targets, // object with targets for each module
} = require('core-js-compat')({
} = compat({
targets: '> 1%', // browserslist query or object of minimum environment versions to support, see below
modules: [ // optional list / filter of modules - regex, sting or an array of them:
'core-js/actual', // - an entry point
Expand Down

0 comments on commit 06c6a56

Please sign in to comment.