Skip to content

Include AST in result of svelte.compile #632

Closed
@Rich-Harris

Description

@Rich-Harris

For cases like sveltejs/v2.svelte.dev#103, it would be useful to have access to the component AST. Should probably sanitize it first (so that internal change-prone things like _scope don't accidentally become depended on) which would be relatively straightforward — if it turns out that has a non-trivial impact on speed (which I doubt) then it could be put behind an option.

const { code, map, ast } = svelte.compile(source);

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