Skip to content

Commit

Permalink
Fix package extry point parsing and bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjrv committed Nov 19, 2018
1 parent a4b71f6 commit cb03fac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/Resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit cb03fac

Please sign in to comment.