baptistebriel / slider-manager

simple wrapper to create sliders focused on animations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module 'babelify' from '/node_modules/slider-manager'

baptistebriel opened this issue · comments

If you're having this error on a project that's not using babelify to compile ES6 to ES5, I just fixed it using the build file of slider-manager as main entry file.

In your package.json file, just add an entry to the "browser" field:

{
  "browser": {
    "slider-manager": "./node_modules/slider-manager/build/manager.min.js"
  }
}

And then, when creating a new instance of slider-manager:

var Manager = require('slider-manager');

var slider = new Manager.default({
  length: length,
  loop: true,
  callback: callback
});

slider.init();