I have a Laravel project where I have some JavaScript files that are ES6 written, for instance I use let. How can I compile this to be compliant to IE11? I assume I need to convert/compile it into ES5.
I came across this
npm install babel-preset-es2015
But I'm not sure if that's it and how to use it in Laravel mix?
I am not using Laravel elixir/mix for long time, tired of slow development, kinda bad design and noway to contribute to it.
Setting babel alone is also a huge pain.
So I created a Bunny Assets builder which just works. It settings defaults to Laravel and it can be used to replace Laravel Mix easily.
Just follow basic steps in Installation and run node build js index -p (for resources/assets/js/index.js file, for example, and add -p if you need compressed production version as well).
If you need only to convert basic syntax, you are done here, if not, you, probably, will need to include also babel helpers.
Wuelber Castillo
Web Development, Backend, PHP, and currently into more and more Javascript
Laravel Mix comes with everything needed for you to compile ES6 code to ES5 easily. It´s all in the docs.