Skip to content

importHelpers does not emit import unless at least one other import is present #12167

Closed
@Jessidhia

Description

@Jessidhia

Noticed on a webpack project with [email protected], using either commonjs or es2015 modules:

// index.ts

import './empty'

async function x () {}
// empty.ts

This emits an import for tslib following by the import for empty. However, commenting the import 'empty' line out also omits the import for tslib, and the emitted code attempts to use a global __awaiter.

I thought this might have been fixed by #12151, but it's still present in current master (built with gulp LKG).

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions