ES6 module's “import” officially compatible with CommonJS and AMD?

早过忘川 提交于 2019-12-05 12:00:19

So far here is what I've understood, but I may be wrong so confirmation/rectifications are welcomed.

  • ECMAScript 6 does not specifies any compatibility with AMD, CommonJS or any other module format. It only allows for ECMAScript 6 Module as defined in the spec.

  • However from this source :

Module Loaders : Not part of ES2015. This is left as implementation-defined within the ECMAScript 2015 specification. The eventual standard will be in WHATWG's Loader specification, but that is currently a work in progress.

Module Loader spec will allow to define your own custom module loader. Thus it will be possible to import AMD, CommonJS, etc... by writing your own loader that will describe how to load such a module. But it will also allow to load for eg coffee script or any other resource as long as our custom module loader describes how to interpret this resource.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!