Skip to content

target in tsconfig doesn't affect esbuild's runtime library #2628

@mengxinssfd

Description

@mengxinssfd

I found that after building the code, there is an extra __spreadValues function, which is written inside var prop in b ||= {}

var __spreadValues = (a, b) => {
  for (var prop in b ||= {})
    if (__hasOwnProp.call(b, prop))
      __defNormalProp(a, prop, b[prop]);
  if (__getOwnPropSymbols)
    for (var prop of __getOwnPropSymbols(b)) {
      if (__propIsEnum.call(b, prop))
        __defNormalProp(a, prop, b[prop]);
    }
  return a;
};

It's using the ECMAScript 2021 - (ES12) feature, when I set the target to a version before ES12, it doesn't work

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions