Laravel 5.4 ES6 compilation in laravel-mix

Hi, I use mix.react to make my js file

I'd like to use ES6 syntax like {...object} etc but laravel-mix based on babel-preset-react package where dossn't support ES6.

I've tried add modules and in .babelrc

{ "presets": ["env","es2016","react"] }

i have no idea how to configure it together with laravel-mix.

jaroslawziolkowski
jaroslawziolkowski
  • 2 weeks ago

Do you have a custom babel rc file in your root folder or are you editing the presets in the node modules?

I have custom .baberc file it make no sense to change in node_modules