Skip to content

Using inject with target and arbitrary module identifiers errors out #4407

@austinw-fineart

Description

@austinw-fineart

Given an inject such as:

import jquery from 'jquery';
export { jquery as 'window.jQuery' };

I should be able to rewrite it as:

export { default as 'window.jQuery' } from 'jquery';

However, esbuild spits this out:
Using the string "window.jQuery" as an export name is not supported in the configured target environment ("chrome111.0", "edge111.0", "firefox112.0", "ios16.4", "safari16.4")
Odd, so I try the targets individually:
✔️ chrome111.0
❌ edge111.0
❌ firefox112.0
❌ ios16.4
❌ safari16.4
I think there's something wrong with the browser support detection.

esbuild playground

This is somewhat similar to #3343 except the target is a browser instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions