mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Unify file.emptyStub and file.imported === "implicit" as file.implicit.
Note that there was a typo in ResourceSlot#addStylesheet, so file.emptyStub was never === true before.
This commit is contained in:
@@ -664,7 +664,7 @@ class ResourceSlot {
|
||||
// If a compiler plugin calls addJavaScript with the same
|
||||
// sourcePath, that code should take precedence over this empty
|
||||
// stub, so this property marks the resource as disposable.
|
||||
emtpyStub: true,
|
||||
implicit: true,
|
||||
lazy: true,
|
||||
});
|
||||
|
||||
|
||||
@@ -160,14 +160,14 @@ export default class ImportScanner {
|
||||
if (old) {
|
||||
// If the old file is just an empty stub, let the new file take
|
||||
// precedence over it.
|
||||
if (old.emptyStub === true) {
|
||||
if (old.implicit === true) {
|
||||
return this.absPathToOutputIndex[absPath] = file;
|
||||
}
|
||||
|
||||
// If the new file is just an empty stub, pretend the _addFile
|
||||
// succeeded by returning the old file, so that we won't try to call
|
||||
// _combineFiles needlessly.
|
||||
if (file.emptyStub === true) {
|
||||
if (file.implicit === true) {
|
||||
return old;
|
||||
}
|
||||
|
||||
@@ -507,11 +507,11 @@ export default class ImportScanner {
|
||||
if (depFile) {
|
||||
// If the module was imported implicitly before, update to the
|
||||
// explicit version now.
|
||||
if (depFile.imported === "implicit") {
|
||||
if (depFile.implicit === true) {
|
||||
const file = this._readModule(absImportedPath);
|
||||
if (file) {
|
||||
depFile.implicit = false;
|
||||
Object.assign(depFile, file);
|
||||
depFile.imported = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -837,13 +837,14 @@ export default class ImportScanner {
|
||||
servePath: relPkgJsonPath,
|
||||
hash: sha1(data),
|
||||
lazy: true,
|
||||
imported: true,
|
||||
// Since _addPkgJsonToOutput is only ever called for package.json
|
||||
// files that are involved in resolving package directories, and
|
||||
// pkg is only a subset of the information in the actual
|
||||
// package.json module, we mark it as being imported implicitly,
|
||||
// so that the subset can be overridden by the actual module if
|
||||
// this package.json file is imported explicitly elsewhere.
|
||||
imported: "implicit",
|
||||
// package.json module, we mark it as imported implicitly, so that
|
||||
// the subset can be overridden by the actual module if this
|
||||
// package.json file is imported explicitly elsewhere.
|
||||
implicit: true,
|
||||
};
|
||||
|
||||
this._addFile(pkgJsonPath, pkgFile);
|
||||
|
||||
Reference in New Issue
Block a user