Fix moduleAttributesVersion errors with stage-0 preset in babel standalone (#11631)

* Fix moduleAttributesVersion errors with stage-0 preset in babel standalone

* Add regression test for stage-0 not erroring on missing moduleattributes version

* Remove moduleAttributesVersion from preset config
This commit is contained in:
Matt Hamlin
2020-05-28 14:35:06 -04:00
committed by GitHub
parent ddfdf00167
commit 8e41f26e12
4 changed files with 49 additions and 30 deletions

View File

@@ -3,11 +3,11 @@ import { declare } from "@babel/helper-plugin-utils";
export default declare((api, { version }) => {
api.assertVersion(7);
if (typeof version !== "string" || version !== "apr-2020") {
if (typeof version !== "string" || version !== "may-2020") {
throw new Error(
"The 'moduleAttributes' plugin requires a 'version' option," +
" representing the last proposal update. Currently, the" +
" only supported value is 'apr-2020'.",
" only supported value is 'may-2020'.",
);
}