Include package name as part of cache key

This commit is contained in:
Michelle Tilley
2016-10-31 23:21:13 -07:00
parent ef5897e72b
commit 2d3afb431c
4 changed files with 9 additions and 8 deletions

View File

@@ -19,9 +19,9 @@ var COMPILERS = {
'.coffee': packageTranspilationRegistry.wrapTranspiler(require('./coffee-script'))
}
exports.addTranspilerConfigForPath = function (packagePath, config) {
exports.addTranspilerConfigForPath = function (packagePath, packageName, config) {
packagePath = fs.realpathSync(packagePath)
packageTranspilationRegistry.addTranspilerConfigForPath(packagePath, config)
packageTranspilationRegistry.addTranspilerConfigForPath(packagePath, packageName, config)
}
exports.removeTranspilerConfigForPath = function (packagePath) {

View File

@@ -13,10 +13,11 @@ function PackageTranspilationRegistry () {
}
Object.assign(PackageTranspilationRegistry.prototype, {
addTranspilerConfigForPath: function (packagePath, config) {
addTranspilerConfigForPath: function (packagePath, packageName, config) {
this.configByPackagePath[packagePath] = {
specs: config,
path: packagePath
name: packageName,
path: packagePath,
specs: config
}
},
@@ -116,7 +117,7 @@ Object.assign(PackageTranspilationRegistry.prototype, {
hash.update(additionalCacheData, 'utf8')
}
return path.join('package-transpile', hash.digest('hex'))
return path.join('package-transpile', spec._config.name, hash.digest('hex'))
},
transpileWithPackageTranspiler: function (sourceCode, filePath, spec) {

View File

@@ -254,7 +254,7 @@ class Package
registerTranspilerConfig: ->
if @metadata.atomTranspilers
CompileCache.addTranspilerConfigForPath(@path, @metadata.atomTranspilers)
CompileCache.addTranspilerConfigForPath(@path, @name, @metadata.atomTranspilers)
unregisterTranspilerConfig: ->
if @metadata.atomTranspilers