How to use the babel-preset-env.buildPreset function in babel-preset-env

To help you get started, we’ve selected a few babel-preset-env 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 NE-LOAN-FED / NE-Component / tools / es2015Preset.js View on Github external
const buildPreset = require('babel-preset-env').buildPreset

const BABEL_ENV = process.env.BABEL_ENV

module.exports = {
  presets: [
    [ buildPreset, {
      loose: true,
      modules: BABEL_ENV === 'es' ? false : 'commonjs'
    } ]
  ]
}

babel-preset-env

A Babel preset for each environment.

MIT
Latest version published 6 years ago

Package Health Score

58 / 100
Full package analysis

Popular babel-preset-env functions