Cannot read property 'Component' of undefined - webpack build of react component plugin
问题 I'm building a react-leaflet wrapper for my leaflet plugin leaflet-arrowheads. Its a component that I want people to be able to install as an npm package, import, and use. The component is simple: import React from 'react' import { Polyline } from 'react-leaflet' import 'leaflet-arrowheads' class ArrowheadsPolyline extends React.Component{ componentDidMount(){ const polyline = this.polylineRef.leafletElement if (this.props.arrowheads){ polyline.arrowheads(this.props.arrowheads) polyline.