Skip to content

Commit

Permalink
add plugin to preset-env
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Apr 24, 2024
1 parent 2e97426 commit fb04bfe
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/babel-preset-env/package.json
Expand Up @@ -55,6 +55,7 @@
"@babel/plugin-transform-destructuring": "workspace:^",
"@babel/plugin-transform-dotall-regex": "workspace:^",
"@babel/plugin-transform-duplicate-keys": "workspace:^",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "workspace:^",
"@babel/plugin-transform-dynamic-import": "workspace:^",
"@babel/plugin-transform-exponentiation-operator": "workspace:^",
"@babel/plugin-transform-export-namespace-from": "workspace:^",
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-preset-env/src/available-plugins.ts
Expand Up @@ -27,6 +27,7 @@ import transformComputedProperties from "@babel/plugin-transform-computed-proper
import transformDestructuring from "@babel/plugin-transform-destructuring";
import transformDotallRegex from "@babel/plugin-transform-dotall-regex";
import transformDuplicateKeys from "@babel/plugin-transform-duplicate-keys";
import transformDuplicateNamedCapturingGroupsRegex from "@babel/plugin-transform-duplicate-named-capturing-groups-regex";
import transformExponentialOperator from "@babel/plugin-transform-exponentiation-operator";
import transformForOf from "@babel/plugin-transform-for-of";
import transformFunctionName from "@babel/plugin-transform-function-name";
Expand Down Expand Up @@ -93,6 +94,7 @@ const availablePlugins = {
"transform-destructuring": () => transformDestructuring,
"transform-dotall-regex": () => transformDotallRegex,
"transform-duplicate-keys": () => transformDuplicateKeys,
"transform-duplicate-named-capturing-groups-regex": () => transformDuplicateNamedCapturingGroupsRegex,
"transform-dynamic-import": () => proposalDynamicImport,
"transform-exponentiation-operator": () => transformExponentialOperator,
"transform-export-namespace-from": () => proposalExportNamespaceFrom,
Expand Down
@@ -0,0 +1 @@
/(?<year>[0-9]{4})-[0-9]{2}|[0-9]{2}-(?<year>[0-9]{4})/.test("12-1995");
@@ -0,0 +1,10 @@
{
"presets": [
[
"env",
{
"targets": "chrome 120"
}
]
]
}
@@ -0,0 +1 @@
/(?<year>[0-9]{4})-[0-9]{2}|[0-9]{2}-(?<year>[0-9]{4})/.test("12-1995");
@@ -0,0 +1,10 @@
{
"presets": [
[
"env",
{
"targets": "chrome 123"
}
]
]
}
3 changes: 3 additions & 0 deletions packages/babel-preset-env/tsconfig.json
Expand Up @@ -67,6 +67,9 @@
{
"path": "../../packages/babel-plugin-transform-duplicate-keys"
},
{
"path": "../../packages/babel-plugin-transform-duplicate-named-capturing-groups-regex"
},
{
"path": "../../packages/babel-plugin-transform-dynamic-import"
},
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Expand Up @@ -4013,6 +4013,7 @@ __metadata:
"@babel/plugin-transform-destructuring": "workspace:^"
"@babel/plugin-transform-dotall-regex": "workspace:^"
"@babel/plugin-transform-duplicate-keys": "workspace:^"
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "workspace:^"
"@babel/plugin-transform-dynamic-import": "workspace:^"
"@babel/plugin-transform-exponentiation-operator": "workspace:^"
"@babel/plugin-transform-export-namespace-from": "workspace:^"
Expand Down

0 comments on commit fb04bfe

Please sign in to comment.