-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use supportsStaticESM to toggle runtime module usage. (#8520)
- Loading branch information
1 parent
e841ccc
commit 39fa102
Showing
9 changed files
with
75 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...s/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class Foo extends Bar {} |
7 changes: 7 additions & 0 deletions
7
...bel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"caller": { | ||
"name": "babel-test", | ||
"supportsStaticESM": true | ||
}, | ||
"plugins": [["transform-runtime", { "useESModules": "auto" }], "transform-classes"] | ||
} |
23 changes: 23 additions & 0 deletions
23
.../babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); | ||
|
||
var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn"); | ||
|
||
var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf"); | ||
|
||
var _inherits = require("@babel/runtime/helpers/inherits"); | ||
|
||
let Foo = | ||
/*#__PURE__*/ | ||
function (_Bar) { | ||
"use strict"; | ||
|
||
_inherits(Foo, _Bar); | ||
|
||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
|
||
return _possibleConstructorReturn(this, _getPrototypeOf(Foo).apply(this, arguments)); | ||
} | ||
|
||
return Foo; | ||
}(Bar); |
4 changes: 4 additions & 0 deletions
4
...es/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"caller": { | ||
"name": "babel-test", | ||
"supportsStaticESM": true | ||
}, | ||
"plugins": [["transform-runtime", { "useESModules": true }], "transform-classes"] | ||
} |
1 change: 1 addition & 0 deletions
1
.../babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/input.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class Foo extends Bar {} |
7 changes: 7 additions & 0 deletions
7
...bel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"caller": { | ||
"name": "babel-test", | ||
"supportsStaticESM": true | ||
}, | ||
"plugins": [["transform-runtime", { "useESModules": "auto" }], "transform-classes"] | ||
} |
18 changes: 18 additions & 0 deletions
18
...babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; | ||
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; | ||
import _inherits from "@babel/runtime/helpers/esm/inherits"; | ||
|
||
let Foo = | ||
/*#__PURE__*/ | ||
function (_Bar) { | ||
_inherits(Foo, _Bar); | ||
|
||
function Foo() { | ||
_classCallCheck(this, Foo); | ||
|
||
return _possibleConstructorReturn(this, _getPrototypeOf(Foo).apply(this, arguments)); | ||
} | ||
|
||
return Foo; | ||
}(Bar); |
4 changes: 4 additions & 0 deletions
4
...es/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
{ | ||
"caller": { | ||
"name": "babel-test", | ||
"supportsStaticESM": true | ||
}, | ||
"plugins": [["transform-runtime", { "useESModules": true }], "transform-classes"] | ||
} |