I am using the Closure compiler to compile a JavaScript file together with a couple of very simple ES6 modules.
demo.js
import {add} from "../modules/adder.js";
import {subtract} from "../modules/subtractor.js";
console.log(add(6, 5));
console.log(subtract(6, 5));
adder.js
export function add(num1, num2) {
return num1 + num2;
}
subtractor.js
export function subtract(num1, num2) {
return num1 - num2;
}
The compiler output JavaScript file is a large file (larger than the inputs) and contains very long variable names such as the following example:
add$$module$Users$mysername$IdeaProjects$myappdir$web$events$es$modules$adder
Is this normal?
I am not concerned about the file size, but if this code is used in production, it is unnecessarily exposing my development machine file structure, including my username.