Skip to content

[doc & comment conflict] document and comments about build.target are a little confused #19034

@zhaojjiang

Description

@zhaojjiang

Describe the bug

about build.target

The document shows

https://vite.dev/guide/build.html#browser-compatibility

Note that by default, Vite only handles syntax transforms and does not cover polyfills.

But the code comment shows except for dynamic import

* and the lowest supported target is es2015/es6. Note this only handles
* syntax transformation and does not cover polyfills (except for dynamic
* import)

A few days ago, we found dynamic-imports compatibility error, so I tried to found more info about the difference bwtween build.target and @vitejs/plugin-legacy, and then found there are some conflict description.

The comment was added since 4 years ago, maybe it is outdated?

Reproduction

document & code comment

Steps to reproduce

No response

System Info

system independent

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationp1-choreDoesn't change code behavior (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions