I am writing a kind of meta application. It is written in React and bundled by webpack. The meta application loads a .js file based on the user input etc. The .js file may not exist at the bundling time. My loading function should just make an HTTP(S) request, try to load the file, and take a function with a known name in the file.
If I just have import(aConstructedPath}) in my loading function, webpack treats it as its directive and generates something like __webpack_require__("./ lazy recursive ^.*$").... How can just just say that this import() should use the built-in one?
I am not sure if you have defined import already. But you can give it a try if you have
const anyName = eval(`import(${aConstructedPath})`);
Where anyName is imported package.
This will make webpack not to rename the code inside ``