diff --git a/lib/aura.extensions.js b/lib/aura.extensions.js index f848cd4..2225976 100644 --- a/lib/aura.extensions.js +++ b/lib/aura.extensions.js @@ -172,6 +172,14 @@ define(['./base', './logger'], function(base, Logger) { ext = getVal(ext, context); if (ext && ext.require && ext.require.paths) { var deps = Object.keys(ext.require.paths) || []; + var bowerPath = context.config.bowerPath || require.s.contexts._.config.paths.bower_components || 'bower_components'; + _.map(ext.require.paths, function(v,k) { + // support legacy path prefixed with bower_components... + // TODO: remove this in 0.10.x + var path = v.replace(/^bower_components\//, ''); + var p = [bowerPath, path].join("/"); + ext.require.paths[k] = p; + }); require.config(ext.require); require(deps, function() { dfd.resolve(ext); diff --git a/lib/base.js b/lib/base.js index d629db9..70ad72d 100644 --- a/lib/base.js +++ b/lib/base.js @@ -1,12 +1,16 @@ (function() { + + var requireConfig = require.s.contexts._.config || {}; + var bowerPath = requireConfig.paths.bower_components || 'bower_components'; + if (window.jQuery) { define('jquery', [], function () { return window.jQuery; }); - } else { + } else if (!requireConfig.paths.jquery) { require.config({ paths: { - jquery: 'bower_components/jquery/jquery' + jquery: bowerPath + '/jquery/jquery' }, shim: { jquery: { exports: '$' } @@ -18,10 +22,10 @@ define('underscore', [], function () { return window._; }); - } else { + } else if (!requireConfig.paths.underscore) { require.config({ paths: { - underscore: 'bower_components/underscore/underscore' + underscore: bowerPath + '/underscore/underscore' }, shim: { underscore: { exports: '_' } diff --git a/lib/ext/components.js b/lib/ext/components.js index 5d336f1..2ddb9b8 100644 --- a/lib/ext/components.js +++ b/lib/ext/components.js @@ -385,7 +385,7 @@ define('aura/ext/components', function() { return { name: 'components', - require: { paths: { text: 'bower_components/requirejs-text/text' } }, + require: { paths: { text: 'requirejs-text/text' } }, initialize: function(app) { @@ -503,7 +503,7 @@ define('aura/ext/components', function() { }, /** - * When all of an application's extensions are finally loaded, the 'extensions' + * When all of an application's extensions are finally loaded, the 'extensions' * afterAppStart methods are then called. * * @method components.afterAppStart diff --git a/lib/ext/mediator.js b/lib/ext/mediator.js index 69260b3..d160179 100644 --- a/lib/ext/mediator.js +++ b/lib/ext/mediator.js @@ -6,8 +6,8 @@ define('aura/ext/mediator', function () { require: { paths: { - eventemitter: 'bower_components/eventemitter2/lib/eventemitter2', - underscore: 'bower_components/underscore/underscore' + eventemitter: 'eventemitter2/lib/eventemitter2', + underscore: 'underscore/underscore' }, shim: { underscore: {