0

My previous tsconfig.json had the following option:

 "module": "commonjs",

To get lazy loading React components to work I had to change it to this:

"module": "esnext",
"moduleResolution": "node",

Which works for lazy loading but other parts of the app I'm working on broke because those parts uses require syntax. Is there a way to keep those working with the new tsconfig values?

Or a way to define multiple configs per project that way I can keep the original and define an additional tsconfig in the places where I need lazy loading?

JonnySins666
  • 65
  • 1
  • 5
  • Are other parts using `import`? – RamblinRose Nov 20 '21 at 04:36
  • Yea most of the app is using imports but a few spots are using require. I could update all the spots using require but it will blow up QA scope and there’s enough places that it would be somewhat significant scope creep so trying to avoid that. – JonnySins666 Nov 20 '21 at 05:17

0 Answers0