also default stage 2 to decoratorsLegacy true [skip ci]
This commit is contained in:
@@ -10,7 +10,7 @@ import transformThrowExpressions from "@babel/plugin-proposal-throw-expressions"
|
||||
export default declare((api, opts = {}) => {
|
||||
api.assertVersion(7);
|
||||
|
||||
const { loose = false, useBuiltIns = false, decoratorsLegacy = false } = opts;
|
||||
const { loose = false, useBuiltIns = false, decoratorsLegacy = true } = opts;
|
||||
|
||||
if (typeof loose !== "boolean") {
|
||||
throw new Error("@babel/preset-stage-2 'loose' option must be a boolean.");
|
||||
@@ -26,14 +26,6 @@ export default declare((api, opts = {}) => {
|
||||
);
|
||||
}
|
||||
|
||||
if (decoratorsLegacy !== true) {
|
||||
throw new Error(
|
||||
"The new decorators proposal is not supported yet." +
|
||||
' You must pass the `"decoratorsLegacy": true` option to' +
|
||||
" @babel/preset-stage-2",
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
presets: [[presetStage3, { loose, useBuiltIns }]],
|
||||
plugins: [
|
||||
|
||||
Reference in New Issue
Block a user