Compare commits

...

3 Commits

Author SHA1 Message Date
Sebastian McKenzie
a38ae381e2 v4.4.2 2015-02-21 14:31:07 +11:00
Sebastian McKenzie
9a2e56f003 add moduleId option for specifying a custom module id 2015-02-21 14:29:26 +11:00
Sebastian McKenzie
5bc78b0237 4.4.1 2015-02-21 14:23:36 +11:00
11 changed files with 25 additions and 19 deletions

View File

@@ -13,6 +13,11 @@ _Note: Gaps between patch versions are faulty/broken releases._
See [CHANGELOG - 6to5](CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
## 4.4.2
* **New Feature**
* Add `moduleId` option for specifying a custom module id.
## 4.4.0
* **New Feature**

View File

@@ -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);

View File

@@ -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 = "";

View File

@@ -1,7 +1,7 @@
{
"name": "babel",
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
"version": "4.4.1",
"version": "4.4.2",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
"repository": "babel/babel",

View File

@@ -1,7 +1,7 @@
{
"name": "babel-runtime",
"description": "babel selfContained runtime",
"version": "4.3.0",
"version": "4.4.1",
"repository": "babel/babel",
"author": "Sebastian McKenzie <sebmck@gmail.com>"
}

View File

@@ -1,5 +0,0 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -0,0 +1,4 @@
{
"moduleIds": true,
"moduleId": "my custom module name"
}

View File

@@ -1,5 +0,0 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -0,0 +1,4 @@
{
"moduleIds": true,
"moduleId": "my custom module name"
}

View File

@@ -1,5 +0,0 @@
exports.getModuleName = function () {
return "my custom module name";
};
exports.moduleIds = true;

View File

@@ -0,0 +1,4 @@
{
"moduleIds": true,
"moduleId": "my custom module name"
}