broccoli-es6-module-transpiler
Advanced tools
Comparing version 0.2.2 to 0.2.3
39
index.js
@@ -177,4 +177,4 @@ 'use strict'; | ||
// Outputs the compiled modules to the cache. | ||
mkdirp.sync(target); | ||
// Creates the output dir, then outputs the compiled modules to the cache. | ||
mkdirp.sync(outputIsFile ? path.dirname(target) : target); | ||
container.write(target); | ||
@@ -186,14 +186,6 @@ | ||
modules.forEach(function (module) { | ||
var hash = hashFile(module.path), | ||
relPath = path.relative(srcDir, module.path), | ||
modImports = module.imports, | ||
modExports = module.exports; | ||
var hash = hashFile(module.path), | ||
relPath = path.relative(srcDir, module.path), | ||
src = module.src; | ||
// If the `module` was built with cached metadata, we want to un-wrap | ||
// its `imports` and `exports` before storing them in the `cacheEntry`. | ||
if (module instanceof CachedModule) { | ||
modImports = Object.getPrototypeOf(modImports); | ||
modExports = Object.getPrototypeOf(modExports); | ||
} | ||
// Adds an entry to the cache for the later use by the CacheResolver. | ||
@@ -204,7 +196,3 @@ // This holds the parsed and walked AST, so re-builds of unchanged | ||
hash: hash, | ||
ast : module.ast, | ||
scope : module.scope, | ||
imports: modImports, | ||
exports: modExports | ||
src : src | ||
}; | ||
@@ -330,14 +318,5 @@ | ||
this.ast = cachedMeta.ast; | ||
this.scope = cachedMeta.scope; | ||
// Shadow cached `module` with `this`. | ||
this.imports = Object.create(cachedMeta.imports, { | ||
module: {value: this} | ||
}); | ||
// Shadow cached `module` with `this`. | ||
this.exports = Object.create(cachedMeta.exports, { | ||
module: {value: this} | ||
}); | ||
// Update the `Module` instance with the cached string srouce that so | ||
// the transpiler doesn't have re-read the file from disk. | ||
this.src = cachedMeta.src; | ||
} | ||
@@ -344,0 +323,0 @@ |
{ | ||
"name": "broccoli-es6-module-transpiler", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Broccoli plugin for Square's ES6 Module Transpiler", | ||
@@ -32,3 +32,3 @@ "main": "index.js", | ||
"broccoli-writer": "^0.1.1", | ||
"es6-module-transpiler": "^0.6.0", | ||
"es6-module-transpiler": "^0.6.2", | ||
"mkdirp": "^0.5.0", | ||
@@ -35,0 +35,0 @@ "quick-temp": "^0.1.2", |
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
18118
324
Updatedes6-module-transpiler@^0.6.2