New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM support: Add support for resolving main from npm's package.json #405

Merged
merged 6 commits into from Oct 20, 2016

Conversation

Projects
None yet
4 participants
@guilleiguaran
Member

guilleiguaran commented Oct 15, 2016

Similarly to Bower, this allow to require NPM libraries using only the name of package finding automatically the main entry point in the package.json. E.g: In the application.js file users would be able to do:

//= require jquery

instead of

//= require jquery/dist/jquery

@guilleiguaran guilleiguaran self-assigned this Oct 15, 2016

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Oct 17, 2016

Member

cc @bouk since you worked in the npm directive.

Member

rafaelfranca commented Oct 17, 2016

cc @bouk since you worked in the npm directive.

@bouk

I like this, I think it makes a lot of sense to include it in Sprockets. Made a couple of comments that are about sticking to the nodejs specification of how the package resolving works, which I think is important to stick to so we don't end up with different behavior

Show outdated Hide outdated lib/sprockets/npm.rb
Show outdated Hide outdated lib/sprockets/npm.rb
Show outdated Hide outdated lib/sprockets/npm.rb
Show outdated Hide outdated lib/sprockets/npm.rb

@guilleiguaran guilleiguaran merged commit 6eac004 into master Oct 20, 2016

4 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment