dependency-lint
Advanced tools
Comparing version 4.1.5 to 4.2.0
# Changelog | ||
### 4.2.0 (2016-10-18) | ||
* extend transpiler configuration to support [babel](http://babeljs.io/) | ||
---- | ||
### 4.1.5 (2016-10-11) | ||
@@ -4,0 +9,0 @@ |
@@ -51,2 +51,3 @@ (function() { | ||
content: content, | ||
dir: dir, | ||
filePath: filePath | ||
@@ -68,4 +69,4 @@ }); | ||
RequiredModuleFinder.prototype.compileIfNeeded = function(arg) { | ||
var compiler, content, ext, filePath, transpiler; | ||
content = arg.content, filePath = arg.filePath; | ||
var compiler, content, dir, ext, filePath, fnName, result, transpiler; | ||
content = arg.content, dir = arg.dir, filePath = arg.filePath; | ||
ext = path.extname(filePath); | ||
@@ -75,5 +76,10 @@ transpiler = _.find(this.transpilers, 'extension', ext); | ||
compiler = require(transpiler.module); | ||
return compiler.compile(content, { | ||
filename: filePath | ||
fnName = transpiler.fnName || 'compile'; | ||
result = compiler[fnName](content, { | ||
filename: path.join(dir, filePath) | ||
}); | ||
if (transpiler.resultKey) { | ||
result = result[transpiler.resultKey]; | ||
} | ||
return result; | ||
} else { | ||
@@ -80,0 +86,0 @@ return content; |
{ | ||
"name": "dependency-lint", | ||
"version": "4.1.5", | ||
"version": "4.2.0", | ||
"description": "Lints npm dependencies and devDependencies", | ||
@@ -40,2 +40,4 @@ "main": "index.js", | ||
"devDependencies": { | ||
"babel-core": "^6.17.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.16.0", | ||
"chai": "^3.0.0", | ||
@@ -42,0 +44,0 @@ "chai-as-promised": "^6.0.0", |
44367
909
14