Skip to content

Typings for the main and browser property in package.json #29128

@Gijsjan

Description

@Gijsjan

Search Terms

package.json typescript browser main isomorphic multiple typings

Suggestion

I have asked a question on StackOverflow (https://stackoverflow.com/questions/53847688/types-field-in-package-json-for-browser-and-main-field), but I have not gotten any reactions and now I'm wondering if it is at all possible. Hence a feature request.

Use Cases

I have build an isomorphic lib, to be used in node and the browser (HuygensING/xmlio). NPM has a solution for that, using the main and browser properties in package.json. But, there is only one typings property. How to specify two different typings? One for the browser and one for node?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions