Skip to content

Commit

Permalink
Migrate from requirejs.entries to has.
Browse files Browse the repository at this point in the history
This fixes the tsc compilation issues.
  • Loading branch information
rwjblue committed May 5, 2020
1 parent dde8fce commit 8c61887
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
/* globals global, requirejs */

import Resolver from '@ember/application/resolver';
import ApplicationInstance from '@ember/application/instance';
import Application from '@ember/application';
import EmberObject from '@ember/object';

import require from 'require';
import require, { has } from 'require';
import Ember from 'ember';

/**
Expand Down Expand Up @@ -91,7 +89,7 @@ export default function (resolver: Resolver) {

exposeRegistryMethodsWithoutDeprecations(container);

if ((requirejs as any).entries['ember-data/setup-container']) {
if (has('ember-data/setup-container')) {
// ember-data is a proper ember-cli addon since 2.3; if no 'import
// 'ember-data'' is present somewhere in the tests, there is also no `DS`
// available on the globalContext and hence ember-data wouldn't be setup
Expand Down
1 change: 1 addition & 0 deletions types/require.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export default function <T = any>(moduleName: string): T;
export function has<T = any>(moduleName: string): T;

0 comments on commit 8c61887

Please sign in to comment.