Skip to content

Commit

Permalink
fix(router-generator): do not register tsx import, instead use its API (
Browse files Browse the repository at this point in the history
#2970)

fixes #2968
  • Loading branch information
schiller-manuel authored Dec 10, 2024
1 parent 359ab15 commit caffc5e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'tsx/esm'
import path, { join, resolve } from 'node:path'
import {
removeExt,
Expand All @@ -8,6 +7,7 @@ import {
} from '../../utils'
import { getRouteNodes as getRouteNodesPhysical } from '../physical/getRouteNodes'
import { virtualRootRouteSchema } from './config'
import { loadConfigFile } from './loadConfigFile'
import type {
VirtualRootRoute,
VirtualRouteNode,
Expand Down Expand Up @@ -99,7 +99,7 @@ async function getVirtualRouteConfigFromFileExport(
) {
throw new Error(`virtualRouteConfig is undefined or empty`)
}
const exports = await import(join(root, tsrConfig.virtualRouteConfig))
const exports = await loadConfigFile(join(root, tsrConfig.virtualRouteConfig))

if (!('routes' in exports) && !('default' in exports)) {
throw new Error(
Expand Down

0 comments on commit caffc5e

Please sign in to comment.