slider-manager icon indicating copy to clipboard operation
slider-manager copied to clipboard

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

Open baptistebriel opened this issue 8 years ago • 0 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();

baptistebriel avatar Feb 17 '17 00:02 baptistebriel