Skip to content

Commit

Permalink
Improve(Cross Import): DEBUG logs
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Jun 12, 2023
1 parent c5a5e56 commit 9e30dfd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/cross-import/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ export default function crossImport(
console.log('[DEBUG: Cross Import] require')
}
return require(resolvedFilePath)
} catch {
} catch (error) {
if (process.env.DEBUG) {
console.log('[Cross Import] JITI')
console.log('[DEBUG: Cross Import] JITI')
console.error(error)
}
return jiti(__filename, {
interopDefault: true,
cache: false,
transform: (options) => {
if (process.env.DEBUG) {
console.log('[DEBUG: Cross Import] JITI transform')
console.error(error)
}
return transform(options.source, {
transforms: ['imports', 'typescript'],
})
Expand Down

0 comments on commit 9e30dfd

Please sign in to comment.