From cb03fac72dc503a5585a963677434889f352cd3a Mon Sep 17 00:00:00 2001 From: jjrv Date: Mon, 19 Nov 2018 05:34:26 +0200 Subject: [PATCH] Fix package extry point parsing and bump version. --- package.json | 2 +- src/Resolver.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ea41c4a..7797f42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cresolve", - "version": "1.0.1", + "version": "1.0.2", "description": "Node-style module resolution for SystemJS", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/Resolver.ts b/src/Resolver.ts index 2e29e3f..5d69871 100644 --- a/src/Resolver.ts +++ b/src/Resolver.ts @@ -281,8 +281,6 @@ export class Resolver { config.packages[packageName] = subConfig; } - subConfig.main = main; - if(typeof(pkg.browser) == 'string') { // Use browser entry point. if(pathName == main) pathName = pkg.browser; @@ -299,6 +297,8 @@ export class Resolver { } } + subConfig.main = main; + for(let key of Object.keys(pkg.dependencies || {})) { if(!this.versionTbl[key]) { this.versionTbl[key] = semverMax( @@ -397,7 +397,7 @@ export class Resolver { parentAddress ? this.getContainingPackage(sys, parentAddress) : Promise.resolve() ).then(() => this.findPackageRoot( - guess, + parentAddress || guess, [ 'https://unpkg.com/' + packageName + '@' + (this.versionTbl[packageName!] || 'latest') ], packageName )).catch(() => Promise.reject(