Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

244
Views
How do I prevent webpack from rewriting import() so that I can use the buildIn one?

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?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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 ``

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!