Skip to content

Commit

Permalink
fix(loader): handle esm default exports for Presenter
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Sep 15, 2019
1 parent 4dc9cf8 commit b697195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Loader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

import { readFileSync } from 'fs'
import { Exception } from '@poppinss/utils'
import { Exception, esmResolver } from '@poppinss/utils'
import requireUncached = require('import-fresh')
import { join, isAbsolute, extname } from 'path'

Expand Down Expand Up @@ -50,7 +50,7 @@ export class Loader implements LoaderContract {
.replace(extname(templatePath), '.presenter.js')

try {
return requireUncached(presenterPath) as LoaderTemplate['Presenter']
return esmResolver(requireUncached(presenterPath)) as LoaderTemplate['Presenter']
} catch (error) {
if (['ENOENT', 'MODULE_NOT_FOUND'].indexOf(error.code) === -1) {
throw error
Expand Down

0 comments on commit b697195

Please sign in to comment.