Created
June 17, 2013 14:51
-
-
Save bartek/5797463 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/template-jasmine-requirejs.js b/src/template-jasmine-requirejs.js | |
index ddb021d..1ecdb54 100644 | |
--- a/src/template-jasmine-requirejs.js | |
+++ b/src/template-jasmine-requirejs.js | |
@@ -56,8 +56,15 @@ exports.process = function(grunt, task, context) { | |
// Remove baseUrl and .js from src files | |
var baseUrl = (context.options.requireConfig && context.options.requireConfig.baseUrl || '/'); | |
+ var paths = (context.options.requireConfig && context.options.requireConfig.paths || {}); | |
+ | |
context.scripts.src.forEach(function(script, i){ | |
script = script.replace(new RegExp('^' + baseUrl),""); | |
+ Object.keys(paths).forEach(function(alias) { | |
+ if (script.indexOf(paths[alias]) !== -1) { | |
+ script = script.replace(paths[alias], alias); | |
+ } | |
+ }); | |
context.scripts.src[i] = script.replace(/\.js$/,""); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment