How to use the browserslist.readConfig function in browserslist

To help you get started, we’ve selected a few browserslist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github indico / indico / bin / maintenance / update_browsers.js View on Github external
function updateBrowserslist() {
  console.log(chalk.whiteBright('Checking browserslist'));
  console.log();
  const data = browserslist.readConfig(BROWSERSLIST_PATH);
  const production = browserslist(null, {
    env: 'production-template',
    config: BROWSERSLIST_PATH,
  });

  const d = diff.diffArrays(data.production, production);
  d.forEach(part => {
    // green for additions, red for deletions
    // grey for common parts
    if (part.added) {
      console.log(chalk.green(part.value.join('\n')));
    } else if (part.removed) {
      console.log(chalk.red(part.value.join('\n')));
    } else {
      console.log(chalk.grey(part.value.join('\n')));
    }
github parcel-bundler / parcel / packages / core / parcel-bundler / src / utils / getTargetEngines.js View on Github external
async function loadBrowserslist(asset, path) {
  let config = await asset.getConfig(['browserslist', '.browserslistrc'], {
    path,
    load: false,
  });

  if (config) {
    return browserslist.readConfig(config);
  }
}
github parcel-bundler / parcel / src / utils / getTargetEngines.js View on Github external
async function loadBrowserslist(asset, path) {
  let config = await asset.getConfig(['browserslist', '.browserslistrc'], {
    path,
    load: false
  });

  if (config) {
    return browserslist.readConfig(config);
  }
}
github kabisa / maji / project_template / config / supported-browsers.js View on Github external
const path = require("path");
module.exports = require("browserslist").readConfig(
  path.join(__dirname, "../browserslist")
).defaults;