javascript - Shorthand for exporting an import -
i've been meaning babeljs, i'm not sure whether babel or specifications support @ moment.
given outer.js
:
export default function() { }
the example below not work.
export outer './outer'
with commonjs modules, written as
exports.x = require('./x');
as of april 3, 2015, babeljs team has released v5.0
3 days ago includes support said shorthand stated in blog post.
lee byron's stage 1 additional export-from statements proposal completes symmetry between import , export statement, allowing export namespaces , defaults external modules without modifying local scope.
exporting default
export foo "bar";
equivalent to:
import _foo "bar"; export { _foo foo };
old answer:
this export notation
export v "mod";
does not supported in es6 (look @ supported examples in specification), can supported in es7 (look @ this proposal).
to achieve exactly same result must use import
now:
import outer './outer'; export {outer};
Comments
Post a Comment