Merge pull request #13810 from backstage/freben/tsx

no longer transpile tsx files in backend packages
This commit is contained in:
Fredrik Adelöw
2022-09-22 19:38:15 +02:00
committed by GitHub
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
---
'@backstage/cli': patch
---
Removed `tsx` and `jsx` as supported extensions in backend packages. For most
repos, this will not have any effect. But if you inadvertently had added some
`tsx`/`jsx` files to your backend package, you may now start to see `code: 'MODULE_NOT_FOUND'` errors when launching the backend locally. The reason for
this is that the offending files get ignored during transpilation. Hence, the
importing file can no longer find anything to import.
The fix is to rename any `.tsx` files in your backend packages to `.ts` instead,
or `.jsx` to `.js`.
+1 -1
View File
@@ -267,7 +267,7 @@ export async function createBackendConfig(
paths.targetRunFile ? paths.targetRunFile : paths.targetEntry,
],
resolve: {
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.json'],
extensions: ['.ts', '.mjs', '.js', '.json'],
mainFields: ['main'],
modules: [paths.rootNodeModules, ...moduleDirs],
plugins: [