@@ -68,14 +68,12 @@ export class Aurelia {
6868 * @return Returns a Promise with the started Aurelia instance.
6969 */
7070 start ( ) : Promise < Aurelia > {
71- if ( this . started ) {
72- return Promise . resolve ( this ) ;
71+ if ( this . _started ) {
72+ return this . _started ;
7373 }
7474
75- this . started = true ;
7675 this . logger . info ( 'Aurelia Starting' ) ;
77-
78- return this . use . apply ( ) . then ( ( ) => {
76+ return this . _started = this . use . apply ( ) . then ( ( ) => {
7977 preventActionlessFormSubmit ( ) ;
8078
8179 if ( ! this . container . hasResolver ( BindingLanguage ) ) {
@@ -378,12 +376,11 @@ export class FrameworkConfiguration {
378376 * @param config The configuration for the specified plugin.
379377 * @return Returns the current FrameworkConfiguration instance.
380378 */
381- feature ( plugin : string , config ? : any ) : FrameworkConfiguration {
382- if ( getExt ( plugin ) ) {
383- return this . plugin ( { moduleId : plugin , resourcesRelativeTo : [ plugin , '' ] , config : config || { } } ) ;
384- }
385-
386- return this . plugin ( { moduleId : plugin + '/index' , resourcesRelativeTo : [ plugin , '' ] , config : config || { } } ) ;
379+ feature ( plugin : string , config ? : any = { } ) : FrameworkConfiguration {
380+ let hasIndex = / \/ i n d e x $ / i. test ( plugin ) ;
381+ let moduleId = hasIndex || getExt ( plugin ) ? plugin : plugin + '/index' ;
382+ let root = hasIndex ? plugin . substr ( 0 , plugin . length - 6 ) : plugin ;
383+ return this . plugin ( { moduleId, resourcesRelativeTo : [ root , '' ] , config } ) ;
387384 }
388385
389386 /**
@@ -461,6 +458,14 @@ export class FrameworkConfiguration {
461458 return this ;
462459 }
463460
461+ // Default configuration helpers
462+ // Note: Please do NOT add PLATFORM.moduleName() around those module names.
463+ // Those functions are not guaranteed to be called, they are here to faciliate
464+ // common configurations. If they are not called, we don't want to include a
465+ // static dependency on those modules.
466+ // Including those modules in the bundle or not is a decision that must be
467+ // taken by the bundling tool, at build time.
468+
464469 /**
465470 * Plugs in the default binding language from aurelia-templating-binding.
466471 * @return Returns the current FrameworkConfiguration instance.
0 commit comments