Fix incorrect main field in npm package #105

Merged
robinnorth merged 2 commits from robinnorth-patch-2 into master 2018-01-18 20:55:28 -05:00
robinnorth commented 2018-01-18 14:27:40 -05:00 (Migrated from github.com)
No description provided.
BehindTheMath commented 2018-01-18 15:49:35 -05:00 (Migrated from github.com)

This was actually on my to do list.

However, I think the main field should point to index.js. If I'm not mistaken, only Node uses the main field, to determine the entry point of the module. Anyone requireing this package in Node is doing the bundling themselves, so we might as well serve the source itself without the Browserify wrapper code. Someone who is using the library in a broswer in a script tag (using unpkg.com) will link to pjax.js directly.

This was actually on my to do list. However, I think the `main` field should point to `index.js`. If I'm not mistaken, only Node uses the `main` field, to determine the entry point of the module. Anyone `require`ing this package in Node is doing the bundling themselves, so we might as well serve the source itself without the Browserify wrapper code. Someone who is using the library in a broswer in a `script` tag (using unpkg.com) will link to `pjax.js` directly.
robinnorth commented 2018-01-18 18:28:32 -05:00 (Migrated from github.com)

You are indeed right, it really should be the other way around. Clearly it used to point to the built library file, but it does make more sense to point at the source. I'll amend my PR for you.

You are indeed right, it really should be the other way around. Clearly it used to point to the built library file, but it does make more sense to point at the source. I'll amend my PR for you.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iLoveElysia/pjax#105