From b697195d269fbe7b173b1ac0cd197134d588dd08 Mon Sep 17 00:00:00 2001
From: Harminder virk <virk.officials@gmail.com>
Date: Sun, 15 Sep 2019 19:34:43 +0530
Subject: [PATCH] fix(loader): handle esm default exports for Presenter

---
 src/Loader/index.ts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Loader/index.ts b/src/Loader/index.ts
index 4ddefe7..749d5ac 100644
--- a/src/Loader/index.ts
+++ b/src/Loader/index.ts
@@ -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'
 
@@ -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