Skip to content

Question: multiple entrypoint package #390

@xiaoxiangmoe

Description

@xiaoxiangmoe

For example, package arch has two entry points: main and browser.

For this kind of package, how should we adapt vite? Should we use Nested conditions as below?

{
  "main": "./main.js",
  "exports": {
    "browser": "./feature-browser.mjs",
    "node": {
      "import": "./feature-node.mjs",
      "require": "./feature-node.cjs"
    }
  }
}

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