Skip to content

browser field can expose globals #1046

@ghost

Description

Yes, I know there is a browserify-shim transform, but it should as easy to expose a global, as it is with b.require. For example, using subarg syntax and the same args for b.require:

"browser" : ["./angular.js", {"expose":"angular"}]

or

"browser" : {
    "angular": [ "./angular.js", {"expose":"angular"}]
}

I see the following advantages over browserify-shim:

  1. Open the floodgates, it is a one-liner PR to convert many existing packages to support browserify
  2. No transform = no dependency, again helpful for convincing others to add support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions