Skip to content

🚀 Feature Request: support import with type syntax (standard now) #7893

@treeder

Description

@treeder

Describe the solution

Workers can import JSON like this:

import Something from './file.json'

But you can't do that anywhere else.

This works in Chrome, Node, etc:

import Something from './file.json'  with {type: "json"}

But does not work in workers, you get:

Image

It would be nice to have workers support "with type" so it can be used in various places without having to change it specifically for workers.

Spec: https://github.com/tc39/proposal-import-attributes

Supported almost everywhere: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#browser_compatibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions