Closed uniphil closed 9 years ago
This is an issue with your compilation process, not this lib.
See the babel-loader usage documentation for example if you are using Webpack, it explicitly excludes node_modules
.
No, the problem is that the src/
directory does not exist on npm install
.
This is not a problem, it is intended.
The modules made to be consumed are in lib
and are exposed by the public API.
So to be clear, react-leaflet
is not extendable by design, and
class CustomizedMarker extends Marker {
is not allowed.
If this is true, then react-leaflet is not for us. Just want to be clear before forking.
No, to be clear, there is nothing preventing you from extending the components as they are already exposed. It's just JavaScript.
Hey, sorry for the tone of my previous messages. This library is an awesome step toward making great map apps, so thank you! I shouldn't jump on github issues before I have my morning coffee :smile:
The problem I was having with extending the components distributed in lib/
was.... I forgot to put lib/
in the import path haha.
I still want to make the case for one more reason to considering distributing with the src/
directory: when extending react-leaflet
components, stack traces that lead into the react-leaflet
uncompiled source are much nicer do dig through. Similar to how leaflet distributes leaflet-src.js
. Any chance of it?
Hey, no problem.
Sure, I'll publish the src
folder as well in future npm releases.
Awesome, thanks! :cake:
Added in RC3 :)
When I
npm install --save react-leaflet
, I get a compiled version that does not include thesrc/
directory.I'm using babel in my own project, so it would be nice to be able to do
My current solution is to add a github tarbal to
package.json
manually:and then import like
however, it would be nice to be able to do this with a normal npm install.