foundation-sites: [6.2] Unknown plugin "transform-es2015-arrow-functions" specified in "../foundation-sites/.babelrc" at 0"

Sorry if this is just from me not setting this up correctly. The .babelrc file included with the bower install of Foundation seems to be causing issues.

Error: ReferenceError: Unknown plugin "transform-es2015-arrow-functions" specified in "/Users/jeremy/Documents/Sites/jointswp-github/wp-content/themes/JointsWP-sass/vendor/foundation-sites/.babelrc" at 0

When I remove the .babelrc file, everything compiles fine.

Here is the Gulp task:

// JSHint, concat, and minify Foundation JavaScript
gulp.task('foundation-js', function() {
  return gulp.src([ 

          // Foundation core - needed if you want to use any of the components below
          './vendor/foundation-sites/js/foundation.core.js',
          './vendor/foundation-sites/js/foundation.util.*.js',

          // Pick the components you need in your project
          './vendor/foundation-sites/js/foundation.abide.js',
          './vendor/foundation-sites/js/foundation.accordion.js',
          './vendor/foundation-sites/js/foundation.accordionMenu.js',
          './vendor/foundation-sites/js/foundation.drilldown.js',
          './vendor/foundation-sites/js/foundation.dropdown.js',
          './vendor/foundation-sites/js/foundation.dropdownMenu.js',
          './vendor/foundation-sites/js/foundation.equalizer.js',
          './vendor/foundation-sites/js/foundation.interchange.js',
          './vendor/foundation-sites/js/foundation.magellan.js',
          './vendor/foundation-sites/js/foundation.offcanvas.js',
          './vendor/foundation-sites/js/foundation.orbit.js',
          './vendor/foundation-sites/js/foundation.responsiveMenu.js',
          './vendor/foundation-sites/js/foundation.responsiveToggle.js',
          './vendor/foundation-sites/js/foundation.reveal.js',
          './vendor/foundation-sites/js/foundation.slider.js',
          './vendor/foundation-sites/js/foundation.sticky.js',
          './vendor/foundation-sites/js/foundation.tabs.js',
          './vendor/foundation-sites/js/foundation.toggler.js',
          './vendor/foundation-sites/js/foundation.tooltip.js',
  ])
    .pipe(babel({
        presets: ['es2015'],
        compact: true
    }))
    .pipe(sourcemaps.init())
    .pipe(concat('foundation.js'))
    .pipe(gulp.dest('./assets/js'))
    .pipe(rename({suffix: '.min'}))
    .pipe(uglify())
    .pipe(sourcemaps.write('.')) // Creates sourcemap for minified Foundation JS
    .pipe(gulp.dest('./assets/js'))
}); 

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks, @erutan.

@JeremyEnglert I’m pretty sure I’m having the exact issue as you, especially since I based a lot of my wp-foundation-sites theme off of your Joints theme.

I don’t get the type error discussed in #8256. So, it’s not a Gulp version issue.

This isn’t a nice solution, but what worked for me is including all of these Babel plugins in the theme’s package.json.

    "babel-plugin-transform-es2015-modules-commonjs": "^6.3.13",
    "babel-plugin-transform-es2015-arrow-functions": "^6.3.13",
    "babel-plugin-transform-es2015-block-scoped-functions": "^6.3.13",
    "babel-plugin-transform-es2015-block-scoping": "^6.4.0",
    "babel-plugin-transform-es2015-classes": "^6.3.15",
    "babel-plugin-transform-es2015-destructuring": "^6.3.15",
    "babel-plugin-transform-es2015-parameters": "^6.3.26",
    "babel-plugin-transform-es2015-shorthand-properties": "^6.5.0",
    "babel-plugin-transform-es2015-spread": "^6.4.0",
    "babel-plugin-transform-es2015-template-literals": "^6.3.13",
    "babel-register": "^6.5.2",

Then running gulp works fine.

Harrumph. 😔