locomotivemtl / locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.54k stars 1.11k forks source link

Replace `defaultLenisOptions` object with function #534

Open somespecialone opened 6 months ago

somespecialone commented 6 months ago

Fixes #507. Guys, thanks for your work! Just really want to fix the problem in Node environment for using SSR/SSG with this lib (I make my own wrapper for Vue/Nuxt).

tekigg commented 6 months ago

How'd you go about implementing this in something like nuxt? :0

somespecialone commented 6 months ago

How'd you go about implementing this in something like nuxt? :0

All actions can and will be ClientOnly, of course. Just don't want to import lib dynamically on client in separate chunk, but can't even import it and build with due to window and document on top of the file

somespecialone commented 6 months ago

@tekigg , after all I ended up with dynamic import on client-side 😁 But, even there I think it is good to give users of the lib the ability to bundle the code

tekigg commented 6 months ago

Nice! It’s what I ended up doing as well. And yeah wouldn’t hurt to have them exported would probably also make implementation easier. Thanks for the help!

schardev commented 2 months ago

@devenini If (for some reason) this is not an ideal solution then could you at least ship non-minified files? I could easily patch source files instead of maintaining my own fork.