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.
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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This was actually on my to do list.
However, I think the
mainfield should point toindex.js. If I'm not mistaken, only Node uses themainfield, to determine the entry point of the module. Anyonerequireing 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 ascripttag (using unpkg.com) will link topjax.jsdirectly.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.