Easy question. In my .js code, inside a module, I had something like:
var MyVar = MyVar || 'anyOtherValue'
When Webpack creates the 'Build" it covnerts it to:
var a = a || 'anyOtherValue'
THE PROBLEM with that is that my HTML is converted by another team into .jsp for a MPA. In each page the backend team injects a Global variable (MyVar) which will be used by the javascript if present:
page1.jsp
<script>
var myVar="New Value";
</script>
Question is: ¿How can I tell Webpack to 'leave' myVar variable with its current name instead of transforming it?
I did following workaround which seems awful to the eyes, though it works:
window.myVar = window.myVar || 'someValue';
Thanks in advance