Skip to content

Support a flag to optimize out export hoisting #13278

@realduolaf

Description

@realduolaf

💻

  • Would you like to work on this feature?

What problem are you trying to solve?

I want to reduce the output code size. When I write this in a source file:

// source
export const a = 1;

I will get this:

// target
"use strict";

exports.__esModule = true;
exports.a = void 0;
const a = 1;
exports.a = a;

Could I reduce the exports.a = void 0; in every file?

By the way

  • for some reasons, I didn't use bundle tools like webpack.
  • I found this link.

Describe the solution you'd like

Add flag such as --optimize-out-export-hoisting to optimise out export hoisting when not needed.

Describe alternatives you've considered

Could someone provide a feasible solution?

Documentation, Adoption, Migration Strategy

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: assumptionsoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions