From 4670e1137bb43cbb0c34d3dadd45f3d98c57cbb3 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Sun, 1 Jan 2017 10:14:35 +1300 Subject: [PATCH] Handle unknown compilers nicer, fallback to passthrough --- src/compiler-host.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compiler-host.js b/src/compiler-host.js index 1e9f528..2a93949 100644 --- a/src/compiler-host.js +++ b/src/compiler-host.js @@ -239,7 +239,11 @@ export default class CompilerHost { if (!compiler) { compiler = this.fallbackCompiler; - let { code, binaryData, mimeType } = await compiler.get(filePath); + if (!compiler) { + compiler = this.getPassthroughCompiler(); + } + + let { code, binaryData, mimeType } = await this.cachesForCompilers.get(compiler).get(filePath); return { code: code || binaryData, mimeType }; }