I have been scouring through the documentation trying to understand the functionality of the import
statement in JavaScript, specifically within the Angular framework. While I grasp the basic concept that it imports modules from other files containing exports, there seems to be a lack of clarity around the various syntax possibilities. One specific issue I am encountering is with the @asymmetik/ngx-leaflet-markercluster module in my Angular application.
During compilation, I am faced with an error message stating "Can't resolve 'leaflet.markercluster' in 'C:\sca_root\city8\node_modules@asymmetrik\ngx-leaflet-markercluster\dist\leaflet-markercluster" in reference to the line:
import 'leaflet.markercluster';
My assumption, however presumptuous it may be, is that there should be a file named leaflet.markercluster.js
or possibly leaflet.markercluster.ts
(for JavaScript, not TypeScript) in the same directory. Yet, upon inspection, none of these files exist in the directory. The existing files include:
leaflet-markercluster.directive.js.map
leaflet-markercluster.directive.metadata.json
leaflet-markercluster.module.d.ts
leaflet-markercluster.module.js
leaflet-markercluster.module.js.map
leaflet-markercluster.module.metadata.json
leaflet-markercluster.directive.d.ts
eaflet-markercluster.directive.js
Which of these files would the import statement refer to? If none are suitable, where else outside this directory could it potentially fetch the file from? Additionally, what other configurations in tsconfig.json or angular.json might influence the source from which this import statement retrieves the file?