Implement custom parser API (#1783)
* feat(api): add custom parser API * test(api): add integration test for parser resolution * chore(api): fix build after resolving conflicts * docs(api): document custom parser API * docs(api): fix typo * chore(build): add parse5 to build and support yarn test --prod
This commit is contained in:
1 parent
486a89bfdc
commit
364c38de0d
10 files changed
+159
-58
No files matched your search
+1
-20
@@ -93,26 +93,7 @@ function getParserOption() {
|
||||
return "flow";
|
||||
}
|
||||
|
||||
if (
|
||||
value === "flow" ||
|
||||
value === "babylon" ||
|
||||
value === "typescript" ||
|
||||
value === "postcss" ||
|
||||
value === "parse5" ||
|
||||
value === "graphql"
|
||||
) {
|
||||
return value;
|
||||
}
|
||||
|
||||
console.warn(
|
||||
"Ignoring unknown --" +
|
||||
optionName +
|
||||
' value, falling back to "babylon":\n' +
|
||||
' Expected "flow" or "babylon", but received: ' +
|
||||
JSON.stringify(value)
|
||||
);
|
||||
|
||||
return "babylon";
|
||||
return value;
|
||||
}
|
||||
|
||||
function getIntOption(optionName) {
|
||||
|
||||
Reference in new issue
Block a user