Because of limitations set by the governance of my current project, I am unable to utilize many of the modern JS libraries and frameworks. Therefore, for our MVP, we are resorting to using vanilla JS directly loaded to the client (un-minified), which is not ideal. Despite this approach highlighting to management that it's not the best solution, I still need to meet deadlines. However, we do have NPM and Node installed on our development machines, and I would like to leverage this to optimize our JS by bundling it into a combined file with a hash to prevent caching.
My question is, how can I gather various separate JS files and integrate them into a new NPM project without having webpack or prettify mangle the expected variables, objects, and functions?
I attempted to simply copy the JS files into the src directory and add the typical import/export statements, but I encountered numerous "identifier not found" errors in the console, indicating that much of the code was being altered.
While I have experience using create-react-app for React projects, this has shielded me from the challenges of setting up a project manually, and now I'm facing the consequences of my lack of expertise.
EDIT: To clarify, I am looking to bundle several existing js files into one package while keeping the same interface. If this is not feasible, please advise accordingly. Otherwise, any guidance on where to begin would be greatly appreciated.