nir9 / itemslide

JavaScript Touch Carousel Library with Zero Dependencies
https://itemslide.org
MIT License
647 stars 85 forks source link

Howto Vanilla + Browserify #15

Closed loranger closed 9 years ago

loranger commented 9 years ago

I'm trying to make itemslide work within a vue.js app. I used npm in order to install itemslider, then with browserify I tried

var itemslide = require("itemslide")

but it didn't work because I don't use/need jQuery.

So i did copy the itemslide.vanilla.min.js inside my app and tried to

var itemslide = require("./itemslide.vanilla.min.js")

but it failed because itemslide is not a function.

I tried

global.itemslide = require("./itemslide.vanilla.min.js")

and

module.exports = require("./itemslide.vanilla.min.js")

but none works.

Did I miss somethnig ? Is there any clue on using vanilla itemslide and browserify ?

nir9 commented 9 years ago

Hi, I still haven't made itemslide compatible with Browserify but i will add this with a guide on how to setup. In the mean time you can include itemslide globally as a script tag.

f0rmat1k commented 9 years ago

@nir9 maybe just something like this

if (typeof exports === 'object') {
    module.exports = Itemslide;
}

...is enough for browserify? And no need to include that polyfill and separate into modules.

nir9 commented 9 years ago

Vanilla is no longer supported. ItemSlide requires jQuery or Zepto. If you want it with Browserify just include ItemSlide and jQuery globally as a script tag.