Skip to content

Commit

Permalink
node 12
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Feb 15, 2024
1 parent 26f3a10 commit e33d216
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/babel-preset-flow/src/index.ts
Expand Up @@ -20,6 +20,16 @@ export default declarePreset((api, opts) => {
];

if (useHermesParser) {
if (Number.parseInt(process.versions.node, 10) < 12) {
throw new Error(
"The Hermes parser is only supported in Node 12 and later.",
);
}
if (IS_STANDALONE) {
throw new Error(
"The Hermes parser is not supported in the @babel/standalone.",
);
}
plugins.unshift("babel-plugin-syntax-hermes-parser");
}

Expand Down
@@ -1,3 +1,4 @@
{
"presets": [["flow", { "useHermesParser": true }]]
"presets": [["flow", { "useHermesParser": true }]],
"minNodeVersion": "12.0.0"
}

0 comments on commit e33d216

Please sign in to comment.