Reputation: 666
Is it possible to use es6 module system and import modules in web browsers?
Upvotes: 1
Views: 924
Reputation: 666
With chrome 61, es6 module system is introduced to the world of web browsers. This link https://developers.google.com/web/fundamentals/primers/modules can be referred for more details on how chrome implements the module system.
Some of the important features of es6 module system discussed in the above link are:
strict
mode.<script type="module" src="example.mjs">
There are some other browsers too which have come up with solutions in their different versions. This below-given link explains the compatibility level of module system in different browsers. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Browser_compatibility
Upvotes: 1