I created a javascript library that follows jQuery syntax but relies entirely on more modern syntax. Whilst everything it uses is supported by ES5, I wrote it using ES6 classes and arrow functions that are not supported by say IE11.
The source is broken up into four files none of which export functions but do use ES6 features. The first creates an object of functions, the second extends the Array class to perform most utilities, the third does the same as the second but for AJAX etc…
I want to combine them all into one output file. This is simple but it remains in ES6 syntax. I’m looking for a way to compile them to a single file and transpose to ES5.
I can see that web pack supports this and I have that installed for other parts of the project. But it relies on module.exports and assumes a much more component based setup. Is there a way to configure it to take all the input files (not exported functions), combine them in a specific order and transpose to ES5 in the process. If so, how to set this up.
Input
./src/init.js
./src/utilities.js
./src/ajax.js
./src/misc.js
Intended Output (with support for ES5 browsers)
./library.js