add support for export extensions https://github.com/leebyron/ecmascript-more-export-from - closes #1091
This commit is contained in:
@@ -2058,3 +2058,55 @@ test('export async function foo(){}', {
|
||||
});
|
||||
|
||||
// ES7 decorators
|
||||
|
||||
// ES7 export extensions - https://github.com/leebyron/ecmascript-more-export-from
|
||||
|
||||
test('export foo from "bar";', {
|
||||
type: "Program",
|
||||
body: [{
|
||||
type: "ExportNamespaceDeclaration",
|
||||
start: 0,
|
||||
end: 22,
|
||||
exported: {
|
||||
type: "Identifier",
|
||||
name: "foo",
|
||||
start: 7,
|
||||
end: 10,
|
||||
},
|
||||
source: {
|
||||
type: "Literal",
|
||||
value: "bar",
|
||||
start: 16,
|
||||
end: 21
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
ecmaVersion: 7,
|
||||
sourceType: "module",
|
||||
features: { "es7.exportExtensions": true }
|
||||
});
|
||||
|
||||
test('export * as foo from "bar";', {
|
||||
type: "Program",
|
||||
body: [{
|
||||
type: "ExportAllDeclaration",
|
||||
start: 0,
|
||||
end: 27,
|
||||
exported: {
|
||||
type: "Identifier",
|
||||
name: "foo",
|
||||
start: 12,
|
||||
end: 15,
|
||||
},
|
||||
source: {
|
||||
type: "Literal",
|
||||
value: "bar",
|
||||
start: 21,
|
||||
end: 26
|
||||
}
|
||||
}]
|
||||
}, {
|
||||
ecmaVersion: 7,
|
||||
sourceType: "module",
|
||||
features: { "es7.exportExtensions": true }
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export foo from "bar";
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var _default = babelHelpers.interopRequire(require("bar"));
|
||||
|
||||
module.exports = _default;
|
||||
@@ -0,0 +1 @@
|
||||
export foo from "bar";
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
|
||||
import _default from "bar";
|
||||
export default _default;
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"blacklist": ["es6.modules"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * as foo from "bar";
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _foo = babelHelpers.interopRequireWildcard(require("bar"));
|
||||
|
||||
exports.foo = _foo;
|
||||
@@ -0,0 +1 @@
|
||||
export * as foo from "bar";
|
||||
@@ -0,0 +1,4 @@
|
||||
"use strict";
|
||||
|
||||
import * as _foo from "bar";
|
||||
export { _foo as foo };
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"blacklist": ["es6.modules"]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"noCheckAst": true,
|
||||
"externalHelpers": true,
|
||||
"optional": "es7.exportExtensions"
|
||||
}
|
||||
Reference in New Issue
Block a user