broccoli-es6-module-transpiler
Advanced tools
Comparing version 0.2.1 to 0.2.2
33
index.js
@@ -38,7 +38,14 @@ 'use strict'; | ||
this.inputTree = inputTree; | ||
this.formatter = formatter; | ||
this.output = options.output || '.'; | ||
this.description = options.description; | ||
var resolverClasses = options.resolvers; | ||
if (!resolverClasses) { | ||
resolverClasses = [ FileResolver ]; | ||
} | ||
this.inputTree = inputTree; | ||
this.resolverClasses = resolverClasses; | ||
this.formatter = formatter; | ||
this.output = options.output || '.'; | ||
this.description = options.description; | ||
this._cache = {}; | ||
@@ -156,6 +163,3 @@ this._cacheIndex = 0; | ||
formatter: this.formatter, | ||
resolvers: [ | ||
new CacheResolver(cache, srcDir), | ||
new FileResolver([srcDir]) | ||
] | ||
resolvers: this.getResolvers(cache, srcDir) | ||
}); | ||
@@ -260,2 +264,15 @@ | ||
CompileModules.prototype.getResolvers = function (cache, srcDir) { | ||
var includePaths = [ srcDir ], | ||
resolvers = []; | ||
resolvers.push(new CacheResolver(cache, srcDir)); | ||
this.resolverClasses.forEach(function (resolverClass) { | ||
resolvers.push(new resolverClass(includePaths)); | ||
}); | ||
return resolvers; | ||
}; | ||
// -- CacheResolver ------------------------------------------------------------ | ||
@@ -262,0 +279,0 @@ |
{ | ||
"name": "broccoli-es6-module-transpiler", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Broccoli plugin for Square's ES6 Module Transpiler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -72,2 +72,10 @@ # Broccoli's ES6 Module Transpiler | ||
`options.resolvers` *{Array}* | ||
An array of resolver classes used to resolve modules to their source code. | ||
Default: `[ FileResolver ]`. | ||
--- | ||
`options.output` *{String}* | ||
@@ -74,0 +82,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18726
341
93