@@ -13,6 +13,7 @@ import type { EngineInstanceOptions } from '@ember/engine/instance';
1313import EngineInstance from '@ember/engine/instance' ;
1414import { RoutingService } from '@ember/routing/-internals' ;
1515import { ComponentLookup } from '@ember/-internals/views' ;
16+ import { StrictResolver } from './lib/strict-resolver' ;
1617import { setupEngineRegistry } from '@ember/-internals/glimmer' ;
1718import { RegistryProxyMixin } from '@ember/-internals/runtime' ;
1819
@@ -328,7 +329,30 @@ class Engine extends Namespace.extend(RegistryProxyMixin) {
328329 @property resolver
329330 @public
330331 */
331- declare Resolver : ResolverClass ;
332+ Resolver : ResolverClass = {
333+ create : ( { namespace } : { namespace : Engine } ) =>
334+ new StrictResolver ( namespace . modules ?? { } , namespace . plurals ) ,
335+ } as unknown as ResolverClass ;
336+
337+ /**
338+ Set this to opt-in to using a strict resolver that will only return the
339+ given set of ES modules. The names of the modules should all be relative to
340+ the root of the app and start with "./"
341+
342+ @property modules
343+ @public
344+ */
345+ declare modules ?: Record < string , unknown > ;
346+
347+ /**
348+ Custom pluralization rules for the strict resolver. By default, types are
349+ pluralized by appending 's' (e.g. 'service' -> 'services'). The 'config'
350+ type is pre-mapped to 'config' (no pluralization).
351+
352+ @property plurals
353+ @public
354+ */
355+ declare plurals ?: Record < string , string > ;
332356
333357 init ( properties : object | undefined ) {
334358 super . init ( properties ) ;
0 commit comments