Skip to content

Support default imports (import X from 'module') #975

@milkyskies

Description

@milkyskies

Floe currently only supports named imports (import { X } from 'module'). Default imports (import X from 'module') are not supported.

This works fine for frontend code because bundlers (Vite, webpack) automatically resolve named imports from default exports via interop. But without a bundler (Node.js, Deno, CLI tools), import { X } from 'module' fails if the package only has a default export.

Proposed syntax

import trusted Markdown from "react-markdown"
import MyLib from "my-lib"

When this matters

  • Server-side Node.js/Deno code
  • CLI tools compiled with Floe
  • Any non-bundled environment

Not urgent

Frontend with Vite covers the current use case. Track for when Floe targets backend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions