Remove optimization that classified all .json files as lazy.

Fixes #6014.
Fixes #6174.
This commit is contained in:
Ben Newman
2016-02-10 17:07:12 -05:00
parent bd144c4cc6
commit 2a3fcf2e7b

View File

@@ -379,20 +379,12 @@ class ResourceSlot {
return lazy;
}
const sourcePath = this.inputResource.path;
if (sourcePath.endsWith(".json")) {
// JSON files have no side effects, so there is no reason for them
// ever to be evaluated eagerly.
return true;
}
// If file.lazy was not previously defined, mark the file lazy if it
// is contained by an imports directory. Note that any files contained
// by a node_modules directory will already have been marked lazy in
// PackageSource#_inferFileOptions.
return this.packageSourceBatch.useMeteorInstall &&
files.pathDirname(sourcePath)
files.pathDirname(this.inputResource.path)
.split(files.pathSep)
.indexOf("imports") >= 0;
}