inherit comments in modules transformer - fixes #280
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
var t = require("../../types");
|
||||
var _ = require("lodash");
|
||||
|
||||
var inheritsComments = function (node, nodes) {
|
||||
if (nodes.length) {
|
||||
t.inheritsComments(nodes[0], node);
|
||||
}
|
||||
};
|
||||
|
||||
exports.ImportDeclaration = function (node, parent, file) {
|
||||
var nodes = [];
|
||||
|
||||
@@ -12,6 +18,8 @@ exports.ImportDeclaration = function (node, parent, file) {
|
||||
file.moduleFormatter.import(node, nodes, parent);
|
||||
}
|
||||
|
||||
inheritsComments(node, nodes);
|
||||
|
||||
return nodes;
|
||||
};
|
||||
|
||||
@@ -33,5 +41,7 @@ exports.ExportDeclaration = function (node, parent, file) {
|
||||
});
|
||||
}
|
||||
|
||||
inheritsComments(node, nodes);
|
||||
|
||||
return nodes;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user