Skip to content

Commit

Permalink
Add syntax import meta to preset env (#15580)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 22, 2023
1 parent 0f492e4 commit 978ea31
Show file tree
Hide file tree
Showing 218 changed files with 260 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/babel-preset-env/package.json
Expand Up @@ -43,6 +43,7 @@
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-export-namespace-from": "^7.8.3",
"@babel/plugin-syntax-import-assertions": "workspace:^",
"@babel/plugin-syntax-import-meta": "^7.10.4",
"@babel/plugin-syntax-json-strings": "^7.8.3",
"@babel/plugin-syntax-logical-assignment-operators": "^7.10.4",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3",
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-preset-env/src/available-plugins.ts
Expand Up @@ -6,6 +6,7 @@ import syntaxClassStaticBlock from "@babel/plugin-syntax-class-static-block";
import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import";
import syntaxExportNamespaceFrom from "@babel/plugin-syntax-export-namespace-from";
import syntaxImportAssertions from "@babel/plugin-syntax-import-assertions";
import syntaxImportMeta from "@babel/plugin-syntax-import-meta";
import syntaxJsonStrings from "@babel/plugin-syntax-json-strings";
import syntaxLogicalAssignmentOperators from "@babel/plugin-syntax-logical-assignment-operators";
import syntaxNullishCoalescingOperator from "@babel/plugin-syntax-nullish-coalescing-operator";
Expand Down Expand Up @@ -89,6 +90,7 @@ export default {
"syntax-dynamic-import": () => syntaxDynamicImport,
"syntax-export-namespace-from": () => syntaxExportNamespaceFrom,
"syntax-import-assertions": () => syntaxImportAssertions,
"syntax-import-meta": () => syntaxImportMeta,
"syntax-json-strings": () => syntaxJsonStrings,
"syntax-logical-assignment-operators": () => syntaxLogicalAssignmentOperators,
"syntax-nullish-coalescing-operator": () => syntaxNullishCoalescingOperator,
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-preset-env/src/index.ts
Expand Up @@ -170,6 +170,9 @@ export const getModulesPluginNames = ({
modulesPluginNames.push("syntax-top-level-await");
}

// Enable import meta for @babel/core < 7.10
modulesPluginNames.push("syntax-import-meta");

return modulesPluginNames;
};

Expand Down
Expand Up @@ -42,5 +42,6 @@ Using plugins:
bugfix/transform-tagged-template-caching { ios < 13, safari < 13 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -40,5 +40,6 @@ Using plugins:
transform-export-namespace-from { android < 72, chrome < 72, edge < 79, firefox < 80, ios, opera < 60, safari, samsung < 11.0 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -40,5 +40,6 @@ Using plugins:
transform-export-namespace-from { android < 72, chrome < 72, edge < 79, firefox < 80, ios, opera < 60, safari, samsung < 11.0 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -42,5 +42,6 @@ Using plugins:
bugfix/transform-tagged-template-caching { ios < 13, safari < 13 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -46,5 +46,6 @@ Using plugins:
transform-export-namespace-from { chrome < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -23,5 +23,6 @@ Using plugins:
transform-export-namespace-from { chrome < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -31,5 +31,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -28,5 +28,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -28,5 +28,6 @@ Using plugins:
transform-export-namespace-from { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -28,5 +28,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -27,5 +27,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -31,5 +31,6 @@ Using plugins:
transform-export-namespace-from { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -31,5 +31,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -28,5 +28,6 @@ Using plugins:
bugfix/transform-edge-function-name { edge < 79 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -32,5 +32,6 @@ Using plugins:
transform-export-namespace-from { safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -33,5 +33,6 @@ Using plugins:
bugfix/transform-tagged-template-caching { safari < 13 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -29,5 +29,6 @@ Using plugins:
bugfix/transform-tagged-template-caching { safari < 13 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -41,5 +41,6 @@ Using plugins:
bugfix/transform-tagged-template-caching { safari < 13 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -22,5 +22,6 @@ Using plugins:
bugfix/transform-safari-id-destructuring-collision-in-function-expression { safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -22,5 +22,6 @@ Using plugins:
transform-export-namespace-from { safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -21,5 +21,6 @@ Using plugins:
transform-modules-commonjs
transform-dynamic-import
transform-export-namespace-from { }
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -22,5 +22,6 @@ Using plugins:
transform-modules-commonjs
transform-dynamic-import
transform-export-namespace-from { }
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -39,6 +39,7 @@ Using plugins:
transform-block-scoping { ios < 11, safari < 11 }
transform-export-namespace-from { android < 72, chrome < 72, edge < 79, firefox < 80, ios, opera < 60, safari, samsung < 11.0 }
syntax-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -41,6 +41,7 @@ Using plugins:
bugfix/transform-safari-id-destructuring-collision-in-function-expression { ios, safari }
bugfix/transform-tagged-template-caching { ios < 13, safari < 13 }
syntax-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -39,6 +39,7 @@ Using plugins:
transform-block-scoping { ios < 11, safari < 11 }
transform-export-namespace-from { android < 72, chrome < 72, edge < 79, firefox < 80, ios, opera < 60, safari, samsung < 11.0 }
syntax-dynamic-import
syntax-import-meta
corejs3: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -41,6 +41,7 @@ Using plugins:
bugfix/transform-safari-id-destructuring-collision-in-function-expression { ios, safari }
bugfix/transform-tagged-template-caching { ios < 13, safari < 13 }
syntax-dynamic-import
syntax-import-meta
corejs3: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -48,5 +48,6 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -52,5 +52,6 @@ Using plugins:
transform-export-namespace-from { android < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -30,5 +30,6 @@ Using plugins:
transform-export-namespace-from { ios, safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -30,5 +30,6 @@ Using plugins:
transform-export-namespace-from { ios, safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -29,5 +29,6 @@ Using plugins:
transform-export-namespace-from { ios, safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -52,5 +52,6 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
Expand Up @@ -50,6 +50,7 @@ Using plugins:
transform-export-namespace-from { android < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -36,6 +36,7 @@ Using plugins:
transform-export-namespace-from { electron < 5.0 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -51,6 +51,7 @@ Using plugins:
transform-reserved-words { }
transform-export-namespace-from { chrome < 72 }
syntax-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -31,6 +31,7 @@ Using plugins:
transform-export-namespace-from { node < 13.2 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -23,6 +23,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -52,6 +52,7 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -23,6 +23,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
syntax-import-assertions
corejs2: `DEBUG` option

Expand Down
Expand Up @@ -52,6 +52,7 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
syntax-import-assertions
corejs2: `DEBUG` option

Expand Down
Expand Up @@ -54,6 +54,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72, edge < 79, firefox < 80, ie, ios, safari }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -52,6 +52,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72, electron < 5.0, ie, node < 13.2 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -51,6 +51,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72, ie, node < 13.2 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -51,6 +51,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72, ie, node < 13.2 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs2: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -23,6 +23,7 @@ Using plugins:
transform-export-namespace-from { chrome < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
syntax-import-assertions
corejs3: `DEBUG` option

Expand Down
Expand Up @@ -52,6 +52,7 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
syntax-import-assertions
corejs3: `DEBUG` option

Expand Down
Expand Up @@ -50,6 +50,7 @@ Using plugins:
transform-export-namespace-from { android < 72 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs3: `DEBUG` option

Using targets: {
Expand Down
Expand Up @@ -52,6 +52,7 @@ Using plugins:
transform-export-namespace-from { ie }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
syntax-import-assertions
corejs3: `DEBUG` option

Expand Down
Expand Up @@ -36,6 +36,7 @@ Using plugins:
transform-export-namespace-from { electron < 5.0 }
transform-modules-commonjs
transform-dynamic-import
syntax-import-meta
corejs3: `DEBUG` option

Using targets: {
Expand Down

0 comments on commit 978ea31

Please sign in to comment.