Fix package browser field descriptor#1046
Conversation
|
I verified I was able to produce a browserify bundle with each of the three libraries as a dependency, producing 3 bundles of differing lengths as expected. |
| "main": "index.js", | ||
| "browser": "dist/protobuf.js", | ||
| "browser": { | ||
| "protobufjs": "./index.js", |
There was a problem hiding this comment.
Are these aliases actually necessary? From my understanding, as the library is imported from the outside already, having them on the inside shouldn't do anything? For example, there is a light.js at the root of the package already that is picked up on require("protobufjs/light").
There was a problem hiding this comment.
Removing the browser entry works, and specifying all three works. Specifying only index.js does not work.
| "protobufjs/light": "./light.js", | ||
| "protobufjs/minimal": "./minimal.js" | ||
| }, | ||
| "browser": "index.js", |
There was a problem hiding this comment.
I think the browser entry can simply be removed (and it should still pick up main). As you pointed out, previous usage in the package.json was essentially wrong.
There was a problem hiding this comment.
Agreed, I will do that. Thanks!
|
Thanks :) |
|
Hi @dcodeIO , is there anything else delaying the release of npm package v6.8.7? Thanks! |
The package browser field descriptor expects an entry point, rather than the bundle file path.
This change specifies an entry point for the three different libraries.
Addresses issue #1045