Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for top-level targets to
@babel/preset-env
- Loading branch information
1 parent
68eb555
commit 7f6a7d8
Showing
7 changed files
with
129 additions
and
28 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
packages/babel-preset-env/test/fixtures/debug/top-level-targets-shadowed/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 @@ | ||
foo?.bar; |
8 changes: 8 additions & 0 deletions
8
packages/babel-preset-env/test/fixtures/debug/top-level-targets-shadowed/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,8 @@ | ||
{ | ||
"validateLogs": true, | ||
"ignoreOutput": true, | ||
"targets": "chrome 80", | ||
"presets": [ | ||
["env", { "debug": true, "targets": "chrome 60" }] | ||
] | ||
} |
26 changes: 26 additions & 0 deletions
26
packages/babel-preset-env/test/fixtures/debug/top-level-targets-shadowed/stdout.txt
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,26 @@ | ||
@babel/preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"chrome": "60" | ||
} | ||
|
||
Using modules transform: auto | ||
|
||
Using plugins: | ||
proposal-numeric-separator { "chrome":"60" } | ||
proposal-logical-assignment-operators { "chrome":"60" } | ||
proposal-nullish-coalescing-operator { "chrome":"60" } | ||
proposal-optional-chaining { "chrome":"60" } | ||
proposal-json-strings { "chrome":"60" } | ||
proposal-optional-catch-binding { "chrome":"60" } | ||
proposal-async-generator-functions { "chrome":"60" } | ||
syntax-object-rest-spread { "chrome":"60" } | ||
transform-dotall-regex { "chrome":"60" } | ||
proposal-unicode-property-regex { "chrome":"60" } | ||
transform-named-capturing-groups-regex { "chrome":"60" } | ||
proposal-export-namespace-from { "chrome":"60" } | ||
transform-modules-commonjs { "chrome":"60" } | ||
proposal-dynamic-import { "chrome":"60" } | ||
|
||
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. |
1 change: 1 addition & 0 deletions
1
packages/babel-preset-env/test/fixtures/debug/top-level-targets/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 @@ | ||
foo?.bar; |
8 changes: 8 additions & 0 deletions
8
packages/babel-preset-env/test/fixtures/debug/top-level-targets/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,8 @@ | ||
{ | ||
"validateLogs": true, | ||
"ignoreOutput": true, | ||
"targets": "chrome 80", | ||
"presets": [ | ||
["env", { "debug": true }] | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/babel-preset-env/test/fixtures/debug/top-level-targets/stdout.txt
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 @@ | ||
@babel/preset-env: `DEBUG` option | ||
|
||
Using targets: | ||
{ | ||
"chrome": "80" | ||
} | ||
|
||
Using modules transform: auto | ||
|
||
Using plugins: | ||
syntax-numeric-separator { "chrome":"80" } | ||
proposal-logical-assignment-operators { "chrome":"80" } | ||
syntax-nullish-coalescing-operator { "chrome":"80" } | ||
syntax-optional-chaining { "chrome":"80" } | ||
syntax-json-strings { "chrome":"80" } | ||
syntax-optional-catch-binding { "chrome":"80" } | ||
syntax-async-generators { "chrome":"80" } | ||
syntax-object-rest-spread { "chrome":"80" } | ||
transform-modules-commonjs { "chrome":"80" } | ||
proposal-dynamic-import { "chrome":"80" } | ||
proposal-export-namespace-from {} | ||
|
||
Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. |