broccoli-es6modules
Advanced tools
Comparing version 0.4.1 to 0.4.2
25
index.js
@@ -50,6 +50,6 @@ var CachingWriter = require('broccoli-caching-writer'); | ||
return this.newTranspilerCache[key] = { | ||
amd: esperanto.toAmd(source, { | ||
amdName: moduleName, | ||
strict: true | ||
}).code | ||
amd: esperanto.toAmd( | ||
source, | ||
this.generateEsperantoOptions(moduleName) | ||
).code | ||
}; | ||
@@ -60,3 +60,20 @@ } catch(err) { | ||
} | ||
}, | ||
generateEsperantoOptions: function(moduleName) { | ||
var providedOptions = this.esperantoOptions || {}; | ||
var result = { | ||
_evilES3SafeReExports: false, | ||
absolutePaths: true, | ||
strict: true | ||
}; | ||
for (var keyName in providedOptions) { | ||
result[keyName] = providedOptions[keyName]; | ||
} | ||
result.amdName = moduleName; | ||
return result; | ||
} | ||
}); |
{ | ||
"name": "broccoli-es6modules", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "An es6 module transpiler & concatenator for broccoli.", | ||
@@ -15,3 +15,3 @@ "main": "index.js", | ||
"broccoli-kitchen-sink-helpers": "^0.2.5", | ||
"esperanto": "^0.6.6", | ||
"esperanto": "^0.6.7", | ||
"mkdirp": "^0.5.0", | ||
@@ -18,0 +18,0 @@ "walk-sync": "^0.1.3" |
@@ -1,2 +0,2 @@ | ||
define('inner/first', ['exports', '../something'], function (exports, Something) { | ||
define('inner/first', ['exports', 'something'], function (exports, Something) { | ||
@@ -3,0 +3,0 @@ 'use strict'; |
@@ -25,2 +25,3 @@ /* global describe, afterEach, it, expect */ | ||
expectFile('outer.js').in(result); | ||
expectFile('reexport.js').in(result); | ||
expectFile('inner/first.js').in(result); | ||
@@ -30,2 +31,15 @@ }); | ||
it('uses esperantoOptions if provided', function() { | ||
var tree = new ES6(fixtures, { | ||
esperantoOptions: { | ||
_evilES3SafeReExports: true | ||
} | ||
}); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().then(function(result) { | ||
expectFile('reexport-es3.js').in(result); | ||
}); | ||
}); | ||
afterEach(function() { | ||
@@ -32,0 +46,0 @@ if (builder) { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
8020
17
176
1
Updatedesperanto@^0.6.7