Skip to content

Support browser export condition out-of-the-box. #7179

@DarrenDanielDay

Description

@DarrenDanielDay

What problem does this feature solve?

When using vue with a bundler such as esbuild, we need to manually configure an alias pointing from vue to vue/dist/vue.esm-bundler.js to get support for the runtime compiler. By adding a browser export condition, tool which supports conditional exports like esbuild can bundle vue with the
correct mapping automatically.

What does the proposed API look like?

No new API will be added, but some additional metadata in vue/package.json:

{
  "exports": {
    ".": {
      "browser": {
        "import": "./dist/vue.esm-browser.js" // or "./dist/vue.esm-browser.prod.js", minified bundle by default
      },
      // ... other export conditions for "vue" entry
     }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions