From ddfd30bc2241e12a08060cf00ce8842bb977cd8c Mon Sep 17 00:00:00 2001 From: Michelle Tilley Date: Wed, 17 May 2017 20:23:59 +0200 Subject: [PATCH] Unregister custom package transpilation config after transpilation --- .../lib/transpile-packages-with-custom-transpiler-paths.js | 1 + src/package-transpilation-registry.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/script/lib/transpile-packages-with-custom-transpiler-paths.js b/script/lib/transpile-packages-with-custom-transpiler-paths.js index 3932a2099..88de56144 100644 --- a/script/lib/transpile-packages-with-custom-transpiler-paths.js +++ b/script/lib/transpile-packages-with-custom-transpiler-paths.js @@ -40,6 +40,7 @@ module.exports = function () { pathsToCompile.forEach(transpilePath) } + CompileCache.removeTranspilerConfigForPath(intermediatePackagePath) rootPackageBackup.restore() intermediatePackageBackup.restore() } diff --git a/src/package-transpilation-registry.js b/src/package-transpilation-registry.js index 483ead897..e5f41233d 100644 --- a/src/package-transpilation-registry.js +++ b/src/package-transpilation-registry.js @@ -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