hongaar / unveil2

:mount_fuji: A very lightweight jQuery plugin to lazy load images
http://nabble.github.io/unveil2
38 stars 11 forks source link

package.json needs "main" property #32

Open kperry42 opened 6 years ago

kperry42 commented 6 years ago

In order for unveil2 to work well as an NPM package, your package.json file ought to specify

 "main": "src/jquery.unveil2.js"

As it stands, I can't, for instance, use it with WebPack, because WebPack doesn't know which file to load when I require "unveil2" in my code. (The default value for main is "index.js", but you don't have a file by that name in your build.)

hongaar commented 6 years ago

Thanks for raising this issue. I'm happy to accept a PR with this change! Can you use import unveil from "unveil2/src/jquery.unveil2" as a workaround?