jspm / npm

NPM Location Service
19 stars 31 forks source link

browser main not being properly resolved #144

Closed guybedford closed 8 years ago

guybedford commented 8 years ago

eg jspm install npm:snabbdom-to-html has in the derived package config for the main (src/index.js):

    "./src/index.js": {
      "browser": "./lib/"
    },

which is then not fully resolved. We should ensure that the conditional maps go through the full resolution process including index.js addition.

perrin4869 commented 8 years ago

@guybedford any update on this issue? Any chance of this landing in the near future? Thanks!

perrin4869 commented 8 years ago

hm... just tried jspm@0.17-beta.26, but the resolution for browser is still the same...

perrin4869 commented 8 years ago

hm... looking at jspm_packages/npm/snabbdom-to-html@2.1.3.json:

{
  "main": "src/index.js",
  "format": "cjs",
  "meta": {
    "*.json": {
      "format": "json"
    }
  },
  "map": {
    "./lib": "./lib/index.js",
    "./src": "./src/index.js",
    "./src/index.js": {
      "browser": "./lib/"
    },
    "./test": "./test/index.js"
  }
}

Since main points to ./src/index.js, which on the browser points to ./lib/ and ./lib points to ./lib/index.js, shouldn't the main in the browser resolve to ./lib/index.js, even without fully resolving browser to ./lib/index.js?

main -> ./src/index.js -(browser)> ./lib/ -> ./lib/index.js

perrin4869 commented 8 years ago

ok clearing the jspm cache at ~/.jspm fixed the problem ><;;

guybedford commented 8 years ago

👍