Implement importInterop: "node" option for module transforms (#12838)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { default } from 'dep';
|
||||
@@ -0,0 +1,8 @@
|
||||
define(["exports", "dep"], function (_exports, _dep) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
_exports.default = _dep;
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export { default, name } from 'dep';
|
||||
@@ -0,0 +1,20 @@
|
||||
define(["exports", "dep"], function (_exports, _dep) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(_exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _dep.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(_exports, "name", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _dep.name;
|
||||
}
|
||||
});
|
||||
_dep = babelHelpers.interopRequireWildcard(_dep, true);
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
export { name } from 'dep';
|
||||
@@ -0,0 +1,13 @@
|
||||
define(["exports", "dep"], function (_exports, _dep) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(_exports, "name", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _dep.name;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import foo from "foo";
|
||||
|
||||
foo();
|
||||
@@ -0,0 +1,5 @@
|
||||
define(["foo"], function (_foo) {
|
||||
"use strict";
|
||||
|
||||
_foo();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import foo, { named } from "foo";
|
||||
|
||||
foo();
|
||||
named();
|
||||
@@ -0,0 +1,7 @@
|
||||
define(["foo"], function (_foo) {
|
||||
"use strict";
|
||||
|
||||
_foo = babelHelpers.interopRequireWildcard(_foo, true);
|
||||
(0, _foo.default)();
|
||||
(0, _foo.named)();
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import { named } from "foo";
|
||||
|
||||
named();
|
||||
@@ -0,0 +1,5 @@
|
||||
define(["foo"], function (_foo) {
|
||||
"use strict";
|
||||
|
||||
(0, _foo.named)();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as foo from 'foo';
|
||||
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
@@ -0,0 +1,7 @@
|
||||
define(["foo"], function (foo) {
|
||||
"use strict";
|
||||
|
||||
foo = babelHelpers.interopRequireWildcard(foo, true);
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
});
|
||||
3
packages/babel-plugin-transform-modules-amd/test/fixtures/importInterop-node/options.json
vendored
Normal file
3
packages/babel-plugin-transform-modules-amd/test/fixtures/importInterop-node/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": [["transform-modules-amd", { "importInterop": "node" }]]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from 'foo';
|
||||
@@ -0,0 +1,13 @@
|
||||
define(["exports", "foo"], function (_exports, _foo) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(_exports, "default", {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _foo.default;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import foo from "foo";
|
||||
|
||||
foo();
|
||||
@@ -0,0 +1,5 @@
|
||||
define(["foo"], function (_foo) {
|
||||
"use strict";
|
||||
|
||||
(0, _foo.default)();
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as foo from 'foo';
|
||||
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
@@ -0,0 +1,6 @@
|
||||
define(["foo"], function (foo) {
|
||||
"use strict";
|
||||
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
});
|
||||
3
packages/babel-plugin-transform-modules-amd/test/fixtures/importInterop-none/options.json
vendored
Normal file
3
packages/babel-plugin-transform-modules-amd/test/fixtures/importInterop-none/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": [["transform-modules-amd", { "importInterop": "none" }]]
|
||||
}
|
||||
Reference in New Issue
Block a user