add moduleId option for specifying a custom module id
This commit is contained in:
@@ -89,7 +89,7 @@ File.validOptions = [
|
||||
"compact",
|
||||
|
||||
"resolveModuleSource",
|
||||
"getModuleName",
|
||||
"moduleId",
|
||||
|
||||
// legacy
|
||||
"format",
|
||||
@@ -138,6 +138,10 @@ File.prototype.normalizeOptions = function (opts) {
|
||||
opts.sourceRoot = slash(opts.sourceRoot);
|
||||
}
|
||||
|
||||
if (opts.moduleId) {
|
||||
opts.moduleIds = true;
|
||||
}
|
||||
|
||||
opts.basename = path.basename(opts.filename, path.extname(opts.filename));
|
||||
|
||||
opts.blacklist = util.arrayify(opts.blacklist);
|
||||
|
||||
@@ -146,7 +146,7 @@ DefaultFormatter.prototype.isLocalReference = function (node, scope) {
|
||||
|
||||
DefaultFormatter.prototype.getModuleName = function () {
|
||||
var opts = this.file.opts;
|
||||
if (opts.getModuleName) return opts.getModuleName(opts.filename);
|
||||
if (opts.moduleId) return opts.moduleId;
|
||||
|
||||
var filenameRelative = opts.filenameRelative;
|
||||
var moduleName = "";
|
||||
|
||||
Reference in New Issue
Block a user