cli: fix react-dom/client check always running from CLI dir

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-10-10 11:41:23 +02:00
parent 6ce5f89833
commit 54c8aa3c43
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
The check for `react-dom/client` will now properly always run from the target directory.
@@ -13,9 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { paths } from '../paths';
export function hasReactDomClient() {
try {
require.resolve('react-dom/client');
require.resolve('react-dom/client', {
paths: [paths.targetDir],
});
return true;
} catch {
return false;