How to use the babel-preset-es2015.default function in babel-preset-es2015

To help you get started, we’ve selected a few babel-preset-es2015 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 babel / babel / packages / babel-standalone / src / gulpTasks.js View on Github external
function webpackBuild(filename, libraryName, version) {
  // If this build is part of a pull request, include the pull request number in
  // the version number.
  if (process.env.CIRCLE_PR_NUMBER) {
    version += '+pr.' + process.env.CIRCLE_PR_NUMBER;
  }
  const typeofPlugin = require("babel-plugin-transform-es2015-typeof-symbol")
    .default;

  // babel-plugin-transform-es2015-typeof-symbol is not idempotent, and something
  // else is already running it, so we need to exclude it from the transform.
  const preset2015 = require("babel-preset-es2015").default();
  const es2015WithoutTypeof = {
    plugins: preset2015.plugins.filter(plugin => plugin !== typeofPlugin),
  };

  const config = {
    module: {
      rules: [
        {
          //exclude: /node_modules/,
          test: /\.js$/,
          loader: "babel-loader",
          options: {
            // Some of the node_modules may have their own "babel" section in
            // their project.json (or a ".babelrc" file). We need to ignore
            // those as we're using our own Babel options.
            babelrc: false,

babel-preset-es2015

Babel preset for all es2015 plugins.

MIT
Latest version published 8 years ago

Package Health Score

64 / 100
Full package analysis