I've been struggling for hours trying to understand what's happening with Babel. The output is completely off-base.
If you need context or files to help find a solution, just let me know. Thank you.
Here is a brief sample of the script.js function:
var nameBuilder = function(firstName="John", lastName="Doe") {
console.log(firstName + " " + lastName);
};
nameBuilder();
Babel output (came in one block of code so I did not indent):
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=1)}([function(e,n,t){"use strict";!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"John",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Doe";console.log(e+" "+n)}()},function(e,n,t){e.exports=t(0)}]);