mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Return {path,id,stat} from Resolver.prototype.resolve.
The id property is an absolute module identifer, suitable for passing to a native Node require function.
This commit is contained in:
@@ -349,7 +349,7 @@ class InputFile extends buildPluginModule.InputFile {
|
||||
const resolver = batch.getResolver();
|
||||
|
||||
return this._resolveCacheStore(
|
||||
id, parentPath, resolver.resolve(id, parentPath).path);
|
||||
id, parentPath, resolver.resolve(id, parentPath).id);
|
||||
}
|
||||
|
||||
require(id, parentPath) {
|
||||
|
||||
@@ -12,6 +12,8 @@ import {
|
||||
pathNormalize,
|
||||
pathDirname,
|
||||
statOrNull as realStatOrNull,
|
||||
convertToOSPath,
|
||||
convertToPosixPath,
|
||||
} from "../fs/files.js";
|
||||
|
||||
const nativeModulesMap = Object.create(null);
|
||||
@@ -108,6 +110,13 @@ export default class Resolver {
|
||||
resolved = this._joinAndStat(dirPath, "index.js");
|
||||
}
|
||||
|
||||
if (resolved) {
|
||||
resolved.id = convertToPosixPath(
|
||||
convertToOSPath(resolved.path),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
return resolved;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user