Add noInterop option to babel-plugin-transform-es2015-modules-commonjs.
The intent of this option is to toggle module interop behavior. When `true` no `interopRequireXXX` helper invocations will be emitted.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export { default } from 'foo';
|
||||
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _foo = require('foo');
|
||||
|
||||
Object.defineProperty(exports, 'default', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _foo.default;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
import foo from "foo";
|
||||
|
||||
foo();
|
||||
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var _foo = require("foo");
|
||||
|
||||
(0, _foo.default)();
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as foo from 'foo';
|
||||
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var _foo = require('foo');
|
||||
|
||||
_foo.bar();
|
||||
_foo.baz();
|
||||
3
packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/noInterop/options.json
vendored
Normal file
3
packages/babel-plugin-transform-es2015-modules-commonjs/test/fixtures/noInterop/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", ["transform-es2015-modules-commonjs", { "noInterop": true }]]
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as foo from 'foo';
|
||||
|
||||
foo.bar();
|
||||
foo.baz();
|
||||
@@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var _foo = require('foo');
|
||||
|
||||
_foo.bar();
|
||||
_foo.baz();
|
||||
Reference in New Issue
Block a user