diff --git a/packages/caching-compiler/caching-compiler.js b/packages/caching-compiler/caching-compiler.js index f8198b360c..308a7a83c8 100644 --- a/packages/caching-compiler/caching-compiler.js +++ b/packages/caching-compiler/caching-compiler.js @@ -316,8 +316,7 @@ CachingCompiler = class CachingCompiler extends CachingCompilerBase { }; if (this.compileOneFileLater && - inputFile.supportsLazyCompilation && - ! this._cacheDebugEnabled) { + inputFile.supportsLazyCompilation) { await this.compileOneFileLater(inputFile, getResult); } else { const result = await getResult(); diff --git a/packages/caching-compiler/multi-file-caching-compiler.js b/packages/caching-compiler/multi-file-caching-compiler.js index 91b03ca386..4b4ceaf72e 100644 --- a/packages/caching-compiler/multi-file-caching-compiler.js +++ b/packages/caching-compiler/multi-file-caching-compiler.js @@ -148,8 +148,7 @@ extends CachingCompilerBase { }; if (this.compileOneFileLater && - inputFile.supportsLazyCompilation && - ! this._cacheDebugEnabled) { + inputFile.supportsLazyCompilation) { if (! this.isRoot(inputFile)) { // If this inputFile is definitely not a root, then it must be // lazy, and this is our last chance to mark it as such, so that diff --git a/tools/isobuild/compiler-plugin.js b/tools/isobuild/compiler-plugin.js index 8f1ada97a8..aeaff516fa 100644 --- a/tools/isobuild/compiler-plugin.js +++ b/tools/isobuild/compiler-plugin.js @@ -722,7 +722,7 @@ class ResourceSlot { }); if (this.packageSourceBatch.useMeteorInstall && - options.lazy) { + cssResource.lazy) { // If the current packageSourceBatch supports modules, and this CSS // file is lazy, add it as a lazy JS module instead of adding it // unconditionally as a CSS resource, so that it can be imported @@ -778,12 +778,15 @@ class ResourceSlot { // stub, so setting .implicit marks the resource as disposable. }).implicit = true; - // If there was an error processing this file, cssResource.data will - // not be a Buffer, and accessing cssResource.data here should cause - // the error to be reported via inputFile.error. - if (Buffer.isBuffer(cssResource.data)) { - this.outputResources.push(cssResource); + if (! cssResource.lazy && + ! Buffer.isBuffer(cssResource.data)) { + // If there was an error processing this file, cssResource.data + // will not be a Buffer, and accessing cssResource.data here + // should cause the error to be reported via inputFile.error. + return; } + + this.outputResources.push(cssResource); } }