Unregister custom package transpilation config after transpilation

This commit is contained in:
Michelle Tilley
2017-05-17 20:23:59 +02:00
parent 6e61fe9a32
commit ddfd30bc22
2 changed files with 8 additions and 0 deletions

View File

@@ -40,6 +40,7 @@ module.exports = function () {
pathsToCompile.forEach(transpilePath)
}
CompileCache.removeTranspilerConfigForPath(intermediatePackagePath)
rootPackageBackup.restore()
intermediatePackageBackup.restore()
}

View File

@@ -29,6 +29,13 @@ class PackageTranspilationRegistry {
removeTranspilerConfigForPath (packagePath) {
delete this.configByPackagePath[packagePath]
const packagePathWithSep = packagePath.endsWith(path.sep) ?
packagePath : packagePath + path.sep;
Object.keys(this.specByFilePath).forEach(filePath => {
if (filePath.startsWith(packagePathWithSep)) {
delete this.specByFilePath[filePath]
}
})
}
// Wraps the transpiler in an object with the same interface