jspm / registry

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

jspm_packages/npm/<package> folder created, but no jspm_packages/npm/<package>.js #990

Closed Ashoat closed 7 years ago

Ashoat commented 7 years ago

Hi there! I am using jspm 0.16.47. I attempted to install a jQuery plugin via an NPM module:

jspm install npm:jquery-dateformat

When I install the module, the jspm_packages/npm/jquery-dateformat@1.0.3 folder is created, but the jspm_packages/npm/jquery-dateformat@1.0.3.js file is not created. As a result, I get file-not-found errors when attempting to run jspm bundle-sfx on a script with import 'jquery-dateformat'.

I was able to "resolve" this issue by creating a jspm_packages/npm/jquery-dateformat@1.0.3.js file:

module.exports = require("npm:jquery-dateformat@1.0.3/dist/jquery-dateFormat");

However, this is obviously unideal, as it adds another step after jspm install, and it's not very discoverable. Is there a way I can configure jspm to handle this correctly? Can it be configured to work correctly on the registry side?

Ashoat commented 7 years ago

Hmm, I think this is because jquery-dateformat's package.json doesn't have a main. And it looks like I can indeed fix this up with a simple { 'main': 'dist/jquery-dateFormat' }. Pull request incoming!