jspm / registry

The jspm registry and package.json override service
https://jspm.io
229 stars 256 forks source link

xlsx package override is incorrect for browser usage #461

Open plwalters opened 9 years ago

plwalters commented 9 years ago

I had to run this command to finally get it to work -

jspm install xlsx -o "{ main: 'dist/xlsx.js', shim: { 'dist/xlsx': { deps: ['jszip'] } }, format: 'global' }"

and then add an additional mapping to jszip in my config.js -

"jszip": "github:SheetJS/jszip@0.0.0",

and finally create an additional jszip@0.0.0.js file under SheetJS in my jspm_packages/github` directory.

I'm not sure the best way to do this with only a package override but I will continue to investigate and hopefully I can PR it. Wanted to leave here as an explanation of the issue.

guybedford commented 9 years ago

It sounds like the override then would be:

{
  "main": "dist/xlsx.js",
  "format": "global",
  "shim": {
    "dist/xlsx": {
      "deps": ["jszip"]
    }
  },
  "dependencies": {
    "jszip": "github:SheetJS/jszip@^0.0.0"
  }
}

Let me know if that works for you here?

plwalters commented 8 years ago

In this case jszip is not an actual package is a dependency of xlsx.js itself so the way I did it was a work-around to get it loading, I think there is probably a better way so I'll leave this open as I research it.

guybedford commented 8 years ago

If it is a local dependency then you can do something like:

{
  "main": "dist/xlsx.js",
  "format": "global",
  "shim": {
    "dist/xlsx": {
      "deps": ["./jszip"]
    }
  }
}