blivesta / drawer

Flexible drawer menu using jQuery, iScroll and CSS.
http://git.blivesta.com/drawer
MIT License
621 stars 176 forks source link

NPM - IScroll is not defined #19

Closed kaspar-allenbach closed 8 years ago

kaspar-allenbach commented 8 years ago

I can't get it to work when I use npm.

I tried every way possible but there is always:

Uncaught ReferenceError: IScroll is not defined

I imported the plugin like this:

require('iscroll/build/iscroll.js');
require('jquery-drawer/dist/js/drawer.js');

or like this:

require('iscroll/build/iscroll.js');
require('jquery-drawer/dist/js/drawer.js');

var IScroll = require('iscroll');
var drawer = require('jquery-drawer');

or like this (according to your docs):

var IScroll = require('iscroll');
var drawer = require('jquery-drawer');

The outcome is always the same: `Uncaught ReferenceError: IScroll is not defined``

In the compiled build both drawer and iscroll are defined.

So I don't see why iscroll isn't recognized.

blivesta commented 8 years ago
IScroll = require('iscroll');

example http://git.blivesta.com/drawer/package-managers/ https://github.com/blivesta/drawer-docs/blob/master/src/js/drawer-docs.js#L1

Kolyunya commented 7 years ago

Do I get it right that it's unusable without Webpack or Browserify? I use neither or them.

I install jquery, iscroll and drawer via npm and getting the IScroll is not defined error.