Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core-js-builder would throw if no polyfill is needed after browserslist query #822

Closed
shrinktofit opened this issue May 8, 2020 · 0 comments
Labels

Comments

@shrinktofit
Copy link

shrinktofit commented May 8, 2020

const fs = require('fs');
const filename = './my-core-js-bundle.js';
require('core-js-builder')({
  modules: ['es'],        // modules / namespaces, by default - all `core-js` modules
  blacklist: [], // blacklist of modules / namespaces, by default - empty list
  targets: 'chrome 80',                               // optional browserslist query
  filename,              // optional target filename, if it's missed a file will not be created
}).then(code => {                                  // code of result polyfill
console.log(code);
  fs.writeFileSync(filename, code);
}).catch(error => {
  // WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
  console.error(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants