Socket
Socket
Sign inDemoInstall

@core-js/builder

Package Overview
Dependencies
79
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @core-js/builder

core-js builder


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

logo

fundraising PRs welcome version

I highly recommend reading this: So, what's next?

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 and build for targets. modules, exclude and targets options are specified in the @core-js/compat format.

import builder from '@core-js/builder';

const { script } = await builder({
  // entry / module / namespace / an array of them, by default - all `core-js` modules
  modules: ['core-js/actual', /^esnext\.reflect\./],
  // a blacklist of entries / modules / namespaces, by default - empty list
  exclude: [/^es\.math\./, 'es.number.constructor'],
  // optional browserslist or @core-js/compat format query
  targets: '> 0.5%, not dead, ie 9-11',
  // shows summary for the bundle, disabled by default
  summary: {
    // in the console, you could specify required parts or set `true` for enable all of them
    console: { size: true, modules: false },
    // in the comment in the target file, similarly to `summary.console`
    comment: { size: false, modules: true },
  },
  // output format, 'bundle' by default, can be 'cjs' or 'esm', and in this case
  // the result will not be bundled and will contain imports of required modules
  format: 'bundle',
  // optional target filename, if it's missed a file will not be created
  filename: PATH_TO_MY_COREJS_BUNDLE,
});

ℹ️ When using TypeScript, make sure to set esModuleInterop to true.

FAQs

Last updated on 13 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc