mirror of
https://github.com/atom/atom.git
synced 2026-02-12 23:55:10 -05:00
Include package name as part of cache key
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user