Module
Symmetry of module importing and exporting.
Una modules are fully compatiable with JavaScript.
You can import JavaScript modules to Una and you can import Una modules to JavaScript.
For better understanding of how to use it you can look at this example
#
ImportSymbol: =->
Translated to JavaScript require
or import
.
First parameter is path.
The second parameter is imported object.
If you pass modules: 'require'
to babel plugin options it works as require
.
If you pass modules: 'import'
or pass nothing to babel plugin options it works as import
.
You can import module:
You can deconstruct the imported module
You just import the module without taking anything from it:
You can import default from module and other fields:
#
ExportSymbol: <-=
Translated to JavaScript module.exports
or export
or export default
.
If you pass modules: 'require'
to babel plugin options it works as modules.export =
.
If you pass modules: 'import'
or pass nothing to babel plugin options it works as export
or export default
.
#
Default module export:Translates to:
or:
#
Constant export:Translates to:
or:
#
Multiple constants export:Translates to: