Skip to content

Commit

Permalink
fix(babel-preset): enable allowDeclareFields with `@babel/plugin-tr…
Browse files Browse the repository at this point in the history
…ansform-typescript` (#168)
  • Loading branch information
JounQin authored Aug 25, 2022
1 parent 3f479fb commit 3b1246d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changeset/pink-adults-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@1stg/app-config": patch
"@1stg/babel-preset": patch
"@1stg/common-config": patch
"@1stg/lib-config": patch
---

fix(babel-preset): enable `allowDeclareFields` with `@babel/plugin-tr…
9 changes: 8 additions & 1 deletion packages/babel-preset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = declare(
decoratorsLegacy = true,
classLoose,
decoratorsBeforeExport = decoratorsLegacy === true ? undefined : true,
allowDeclareFields = true,
},
) => {
api.assertVersion(7)
Expand Down Expand Up @@ -82,12 +83,18 @@ module.exports = declare(
{
isTSX,
allExtensions: isTSX,
allowDeclareFields: true,
allowDeclareFields,
},
])
}

const plugins = [
[
require('@babel/plugin-transform-typescript'),
{
allowDeclareFields,
},
],
[
require('@babel/plugin-proposal-decorators'),
{
Expand Down

0 comments on commit 3b1246d

Please sign in to comment.