Fix #10409 by ignoring self-referential browser aliases in package.json.

This commit is contained in:
Ben Newman
2019-01-10 11:15:19 -05:00
parent be4cc2bd36
commit dea96ecac6
4 changed files with 20 additions and 0 deletions

View File

@@ -1422,6 +1422,12 @@ export default class ImportScanner {
return;
}
// Ignore useless self-referential browser aliases, to fix
// https://github.com/meteor/meteor/issues/10409.
if (target.id === source.id) {
return;
}
Object.assign(alias, target);
alias.absModuleId = this._getAbsModuleId(target.path);

View File

@@ -1210,6 +1210,11 @@
"minimist": "0.0.8"
}
},
"mobx": {
"version": "5.8.0",
"resolved": "https://registry.npmjs.org/mobx/-/mobx-5.8.0.tgz",
"integrity": "sha512-NsZB+9bF5j+nv9Qwk6bNeE3np26a4TbTGkMpOLf6o1zXoM9BtHPQn/00px4uZ2AXJXtQML5P4MEWdMm6icMIfQ=="
},
"moment": {
"version": "2.22.2",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",

View File

@@ -17,6 +17,7 @@
"jsx-import-test": "file:imports/links/jsx-import-test",
"lodash-es": "^4.17.7",
"meteor-node-stubs": "^0.4.1",
"mobx": "5.8.0",
"moment": "^2.22.2",
"mssql": "^3.1.1",
"mysql": "^2.15.0",

View File

@@ -660,3 +660,11 @@ describe("imported *.tests.js modules", () => {
assert.strictEqual(name, "imported.tests.js");
});
});
describe("issue #10409", () => {
it("should be able to import mobx@5.8.0", () => {
const { observable, action } = require("mobx");
assert.strictEqual(typeof observable, "function");
assert.strictEqual(typeof action, "function");
});
});