tbranyen / hyperlist

A performant virtual scrolling list utility capable of rendering millions of rows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected usage via CommonJS

timwis opened this issue · comments

If you want to use this library via CommonJS, you need to use the default property on the object it exports.

Expected functionality:

var HyperList = require('hyperlist')

At this point, HyperList will be an object with a default property. The default property contains the actual HyperList object described in the documentation.

Current work-around:

var HyperList = require('hyperlist').default

I assume this has to do with however you're translating the ES2015 export into CommonJS as this line appears to be the culprit.

@timwis Thanks for the issue, this was an oversight, https://www.npmjs.com/package/babel-plugin-add-module-exports should be added to produce a more usable CJS

Okay, I'll throw together a PR