mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Stop eagerly forcing compilation of lazy CssOutputResources.
This should be a better fix for the problem I tried to fix with
479e505d71.
If we're going to be using compileOneFileLater by default, that's what we
should be testing in the compiler plugins self-tests.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user