Skip to content

Add the @babel/plugin-syntax-import-attributes plugin to allow JSON imports with type assertion #251

@BinToss

Description

@BinToss

Babel throws when an import attribute such as import abc from "./abc.json" with { type: "json" } or await import("./abc.json", { assert: { type: "json" } }) is present in a source file; it suggests using @babel/plugin-syntax-import-attributes to resolve the issue.

note: to enable parsing the deprecated import abc from "./abs.json" assert { type: "json" } syntax, the plugin's deprecatedAssertSyntax option must be true (default: false).

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