ressio / lazy-load-xt

Lazy load XT is a jQuery plugin for images, videos and other media
http://ress.io/lazy-load-xt-jquery/
MIT License
1.36k stars 245 forks source link

webpack/browserify #92

Open adyz opened 8 years ago

adyz commented 8 years ago

Hi guys,

Any way to require this plugin with webppack or browserify?

var lazyloadxt = require('lazyloadxt');

bajax commented 5 years ago

I know this is a two year old comment, but I thought I'd reply for people like me who might have come across this thread when searching for the answer. It is already possible to use this with Browserify, but you have to reference the source file you want explicitly in your require statement, like so:

require('lazyloadxt/dist/jquery.lazyloadxt')

Make sure that a reference to jQuery is available in the global context when you do this since it installs itself automatically.