Skip to content

Commit

Permalink
feat: enable experimental decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Dec 24, 2023
1 parent 9272c9f commit af07e9d
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 218 deletions.
4 changes: 2 additions & 2 deletions measure-bundle-size/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test": "jest"
},
"dependencies": {
"@babel/parser": "^7.15.8",
"@babel/traverse": "^7.15.4",
"@babel/parser": "^7.23.6",
"@babel/traverse": "^7.23.6",
"bytes": "^3.1.0",
"debug": "^4.3.2",
"escalade": "^3.1.1"
Expand Down
7 changes: 6 additions & 1 deletion measure-bundle-size/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export type ParseResult = {
export const parse = (input: string): ParseResult => {
const ast = parser.parse(input, {
sourceType: 'module',
plugins: ['jsx', 'typescript'],
plugins: [
'jsx',
'typescript',
// https://babeljs.io/docs/babel-plugin-proposal-decorators
['decorators', {}],
],
})
if (ast.errors.length) {
throw new Error(ast.errors[0].code)
Expand Down
Loading

0 comments on commit af07e9d

Please sign in to comment.