I'm trying to convert an old JavaScript library into ES6 compatible module.
The library is tracking.js (https://github.com/eduardolundgren/tracking.js/blob/master/build/tracking.js) but all my results ends with: Cannot read property 'xxx' of undefined
Is there any easy way to use such module? I'm trying to create just basic example like https://trackingjs.com/docs.html#step-2
Update
Because there is a request for more code. Let me show one of the non-working examples (part of Vue.js component):
import tracking from 'tracking';
export default {
created() {
const colors = new tracking.ColorTracker(['magenta', 'cyan', 'yellow']);
}
};
And the error is TypeError: _tracking2.default.ColorTracker is not a constructor