Skip to content

Commit

Permalink
Import loader.js require
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0gr committed Jun 19, 2019
1 parent 3370095 commit 0c7aeb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion addon/index.ts
@@ -1,7 +1,8 @@
import Engine from '@ember/engine';
import require from 'require';

function resolveInitializer(moduleName: string) {
var module = self.require(moduleName, null, null, true);
var module = require(moduleName, null, null, true);
if (!module) {
throw new Error(moduleName + ' must export an initializer.');
}
Expand Down
1 change: 0 additions & 1 deletion types/loader.js/index.d.ts
Expand Up @@ -2,7 +2,6 @@ export {}

declare global {
interface Window {
require(moduleName: string, ...args: any[]): any

requirejs: {
_eak_seen: {
Expand Down
5 changes: 5 additions & 0 deletions types/loader.js/require.d.ts
@@ -0,0 +1,5 @@
declare module 'require' {
function require(moduleName: string, ...args: any[]): any;

export default require;
}

0 comments on commit 0c7aeb6

Please sign in to comment.