My app utilizes the d3 library with TypeScript code, and I have encountered an issue. To avoid compiler error TS2686, which occurs when d3 refers to a UMD global in a module file, I need to add the following line:
import * as d3 from 'd3';
However, this results in emitting:
require('d3');
in the JavaScript code. The problem is that the d3 library is located under the root of the web app in a directory named 'd3', not where it is being required in the JavaScript. Additionally, the d3 library is already loaded globally in our index.html, so there is no need for it to be included in the JavaScript.
I am struggling to find a way to reference d3 in TypeScript without using the import statement.