JavaScript for WordPress Forums The WP REST API 2.1.13.02 Setting Up The Project Reply To: 2.1.13.02 Setting Up The Project

#36960
Juliette Tworsey
Participant

Hi Zac,

I don’t think that there is anything wrong (that I know of) with the code that you have provided in the examples, though I did have to add a .babelrc file (via a recommendation from Babel https://babeljs.io/docs/plugins/transform-runtime/ ).

This is what I have added to my .babelrc file:


{
  "presets":
	[
		"es2015"
	],
  "plugins": [
    ["transform-runtime", {
      "helpers": false,
      "polyfill": false,
      "regenerator": true,
      "moduleName": "babel-runtime"
    }]
  ]
}

I realize that including es2015 in this file may be redundant(?) due to the fact that es2015 is already listed as a preset in thewebpack-config.js file. I’m relatively new to Webpack so I just put it in there for safe measure. Is this an unneeded action?

Cheers:-)