digidem / leaflet-side-by-side

A Leaflet control to add a split screen to compare two map overlays
http://lab.digital-democracy.org/leaflet-side-by-side/
MIT License
351 stars 111 forks source link

Issue in Nextjs app while rendering css #54

Open santoshkaranam opened 1 year ago

santoshkaranam commented 1 year ago

NextJs: Global CSS cannot be imported from within node_modules. https://github.com/vercel/next.js/issues/19936

nextjs restricts importing csss from node modules folder. file here: https://github.com/digidem/leaflet-side-by-side/blob/gh-pages/index.js has 2 css imports

require('./layout.css')
require('./range.css')

which dont work in nextjs.

santoshkaranam commented 1 year ago

i have fixed it by removing those css and directly importing from my app code using cdn https://cdn.jsdelivr.net/gh/digidem/leaflet-side-by-side/layout.css https://cdn.jsdelivr.net/gh/digidem/leaflet-side-by-side/range.css

i will raise a pull request.