fix snippet loading in build
This commit is contained in:
parent
3139b3964d
commit
d2be8aefc0
1 changed files with 13 additions and 4 deletions
|
|
@ -77,17 +77,26 @@ exports.moduleUrl = function(name, component) {
|
|||
|
||||
var parts = name.split("/");
|
||||
component = component || parts[parts.length - 2] || "";
|
||||
var re = new RegExp("^" + component + "[\-_]|[\-_]" + component + "$", "g");
|
||||
base = base.replace(re, "");
|
||||
|
||||
// todo make this configurable or get rid of '-'
|
||||
var sep = component == "snippets" ? "/" : "-";
|
||||
var base = parts[parts.length - 1];
|
||||
if (sep == "-") {
|
||||
var re = new RegExp("^" + component + "[\-_]|[\-_]" + component + "$", "g");
|
||||
base = base.replace(re, "");
|
||||
}
|
||||
|
||||
if (!base && parts.length > 1)
|
||||
base = parts[parts.length - 2];
|
||||
var path = options[component + "Path"];
|
||||
if (path == null)
|
||||
if (path == null) {
|
||||
path = options.basePath;
|
||||
} else if (sep == "/") {
|
||||
component = sep = "";
|
||||
}
|
||||
if (path && path.slice(-1) != "/")
|
||||
path += "/";
|
||||
return path + component + "-" + base + this.get("suffix");
|
||||
return path + component + sep + base + this.get("suffix");
|
||||
};
|
||||
|
||||
exports.setModuleUrl = function(name, subst) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue