Namespace with ES6 Modules

How to assign a namespace using ES6 modules? I would like to do this, for example, jQuery does where the namespace is $, but it does so in the intended way of ES6. All my modules are structured in separate files that export classes / functions / as by default (for example, export default class Pikachu). How to import it into another (main) file so that the user can access this class using, for example Namespace.Pikachu,?

I realized that this may be related to the name of the export, but I'm not quite sure how to do this. Any help please?

+4
source share
1 answer

, .

- , .

, callsite , .

, , .

+5

Source: https://habr.com/ru/post/1627711/


All Articles