I am writing a JS library. The core file of the library is an ES6 file that exports a default class, which sits in the following location './lib/myclass'
I want users of my library to be able to import the the library from the root of the repository. To achieve this in ES5 I can put the following into an index.js
file at the root:
module.exports = require('./lib/myclass');
How can I do this using default exports in ES6? I would also like to use the ES6 way of importing. I realise that I can still do it the ES5 way, but I am just trying to understand how these new statements work.
Thanks