Skip to content

Commit 0ac7324

Browse files
AntoLClunika
authored andcommitted
✅(frontend) adapt babel to interpret declare keyword in typescript
When we adapted the class in the plugin video.js, we use the keyword "declare", which is not interpreted by babel. We need to add a plugin to babel to interpret this keyword correctly.
1 parent cee17f3 commit 0ac7324

File tree

8 files changed

+23
-1
lines changed

8 files changed

+23
-1
lines changed

src/frontend/apps/lti_site/babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
module.exports = {
22
plugins: [
3+
[
4+
'@babel/plugin-transform-typescript',
5+
{
6+
allowDeclareFields: true,
7+
},
8+
],
39
[
410
'react-intl',
511
{

src/frontend/apps/lti_site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@babel/core": "7.23.9",
2626
"@babel/plugin-proposal-class-properties": "7.18.6",
2727
"@babel/plugin-syntax-dynamic-import": "7.8.3",
28+
"@babel/plugin-transform-typescript": "*",
2829
"@babel/polyfill": "7.12.1",
2930
"@babel/preset-env": "7.23.9",
3031
"@babel/preset-react": "7.23.3",

src/frontend/apps/standalone_site/babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ module.exports = babelJest.createTransformer({
1212
ast: true,
1313
},
1414
],
15+
[
16+
'@babel/plugin-transform-typescript',
17+
{
18+
allowDeclareFields: true,
19+
},
20+
],
1521
'babel-plugin-import-remove-resource-query',
1622
'@babel/plugin-syntax-dynamic-import',
1723
'babel-plugin-transform-vite-meta-env',

src/frontend/apps/standalone_site/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"devDependencies": {
4040
"@babel/core": "7.23.9",
4141
"@babel/plugin-syntax-dynamic-import": "7.8.3",
42+
"@babel/plugin-transform-typescript": "*",
4243
"@babel/preset-env": "7.23.9",
4344
"@babel/preset-typescript": "7.23.3",
4445
"@testing-library/jest-dom": "*",

src/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
},
4141
"resolutions": {
4242
"@babel/plugin-proposal-private-property-in-object": "7.21.11",
43+
"@babel/plugin-transform-typescript": "7.23.6",
4344
"@codemirror/lang-markdown": "6.2.4",
4445
"@codemirror/language": "6.10.1",
4546
"@codemirror/language-data": "6.4.1",

src/frontend/packages/lib_video/babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ module.exports = {
88
ast: true,
99
},
1010
],
11+
[
12+
'@babel/plugin-transform-typescript',
13+
{
14+
allowDeclareFields: true,
15+
},
16+
],
1117
'@babel/proposal-class-properties',
1218
'@babel/plugin-syntax-dynamic-import',
1319
'@babel/plugin-transform-runtime',

src/frontend/packages/lib_video/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@babel/plugin-proposal-class-properties": "7.18.6",
3434
"@babel/plugin-syntax-dynamic-import": "7.8.3",
3535
"@babel/plugin-transform-runtime": "7.23.9",
36+
"@babel/plugin-transform-typescript": "*",
3637
"@babel/polyfill": "7.12.1",
3738
"@babel/preset-env": "7.23.9",
3839
"@babel/preset-typescript": "7.23.3",

src/frontend/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@
11161116
dependencies:
11171117
"@babel/helper-plugin-utils" "^7.22.5"
11181118

1119-
"@babel/plugin-transform-typescript@^7.23.3":
1119+
"@babel/plugin-transform-typescript@*", "@babel/[email protected]", "@babel/plugin-transform-typescript@^7.23.3":
11201120
version "7.23.6"
11211121
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.6.tgz#aa36a94e5da8d94339ae3a4e22d40ed287feb34c"
11221122
integrity sha512-6cBG5mBvUu4VUD04OHKnYzbuHNP8huDsD3EDqqpIpsswTDoqHCjLoHb6+QgsV1WsT2nipRqCPgxD3LXnEO7XfA==

0 commit comments

Comments
 (0)