aubreypwd / wpkickstart

A great way to kickstart a new WordPress plugin or project.
9 stars 0 forks source link

Add ES6 Support #18

Open aubreypwd opened 5 years ago

aubreypwd commented 5 years ago

Writing ES6 takes a great deal of work to get it to work in ES5 browers, etc. I know there are ways to write ES6 code and transpile it down to ES5 for other browsers. Let's make it really easy to write ES6 yet enqueue ES5 versions of it.

aubreypwd commented 5 years ago

@efuller getting you involved here as promised!

So here are my initial thoughts:

I want whatever this is to simply make an ES5 version of my ES6 script e.g. I make services/my-service/assets/js/my-script.js and it's written in ES6. The thing we build finds that ES6 script (automagically, maybe it has an @es6 tag in the filedoc maybe there's a thing out there that can detect an ES6 script?) and makes a services/my-service/assets/js/es5/my-script.js file I can enqueue safely.

I'm thinking that simple. That way I can write in whatever I want and our tool here will just compile es5 versions of the code for us to use. Open to discussing this further.