Hi, thanks for the effort you put into this plugin. I have trouble trying to import EasyButton as a node_module to make it work with webpack. This might be more of a webpack-related question but maybe you have an idea on how to solve this.
I tried loading EasyButton into my index.js (which is the entry for webpack bundling) with the following statements in analogy to this thread.
import L from 'leaflet';
import FreeDraw from 'leaflet-freedraw';
import 'leaflet-easybutton';
Importing FreeDraw this way works flawlessly. I get the following error in my console: "leafletWEBPACK_IMPORTED_MODULE0default.a.easyButton is not a function". I haven't fully understood how webpack and modules work but apparently EasyButton lacks export statements (which are necessary to import?). Any advice on how I can make EasyButton work without using a CDN? Help much appreciated!
Hi, thanks for the effort you put into this plugin. I have trouble trying to import EasyButton as a node_module to make it work with webpack. This might be more of a webpack-related question but maybe you have an idea on how to solve this.
I tried loading EasyButton into my index.js (which is the entry for webpack bundling) with the following statements in analogy to this thread.
Importing FreeDraw this way works flawlessly. I get the following error in my console: "leafletWEBPACK_IMPORTED_MODULE0default.a.easyButton is not a function". I haven't fully understood how webpack and modules work but apparently EasyButton lacks
export
statements (which are necessary toimport
?). Any advice on how I can make EasyButton work without using a CDN? Help much appreciated!