humangeo / leaflet-tilefilter

Change the appearance of Leaflet map tiles on the fly using a variety of canvas or CSS3 image filters. It's like Instagram for Leaflet map tiles.
MIT License
97 stars 19 forks source link

Use with Webpack? #8

Closed fnick851 closed 4 years ago

fnick851 commented 5 years ago

Probably a dumb question, but what is the most appropriate way to integrate this with a Webpack project?

I am working on a project built with Vue, Leaflet, and Webpack. Could you provide some guidance on this? Thanks.

sfairgrieve commented 5 years ago

I haven't used this with webpack before, but I think it should be possible. The current codebase doesn't use modules or support newer ways of exporting functions, but I think you could add the specific JS file leaflet-tilefilter.js to the entry list in your webpack config and use the webpack ProvidePlugin to make Leaflet's global L property available: https://webpack.js.org/guides/shimming/.