mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
add file extension check for external package resolution
This commit is contained in:
@@ -90,11 +90,14 @@ export class RequireExternalsPlugin {
|
||||
_extractPackageName(name) {
|
||||
let pkg = name.slice(this._defaultExternalPrefix.length);
|
||||
if (pkg.startsWith('"') && pkg.endsWith('"')) pkg = pkg.slice(1, -1);
|
||||
|
||||
const depInfo = path.parse(name);
|
||||
// If the extracted package name is a path, use the path as is
|
||||
if (
|
||||
pkg &&
|
||||
(path.isAbsolute(pkg) || pkg.startsWith('./') || pkg.startsWith('../'))
|
||||
(path.isAbsolute(pkg) ||
|
||||
pkg.startsWith('./') ||
|
||||
pkg.startsWith('../') ||
|
||||
!!depInfo.ext)
|
||||
) {
|
||||
const module = this.externalsMeta.get(pkg);
|
||||
if (module) {
|
||||
|
||||
Reference in New Issue
Block a user