Skip to content

Adding constants breaks export #228

@buhrmi

Description

@buhrmi

Hi there,

running into the issue that when I add constants to my module, the esm autoexports filter creates invalid syntax.

This works fine

module Hello
  def hi()
    puts "hello"
  end
end

But this doesn't:

module Hello
  WORD = "world"
  def hi()
    puts WORD
  end
end

The javascript it generates is missing a const between export and Hello

export Hello = (() => {
  const WORD = "world";

  function hi() {
    return console.log(WORD)
  };

  return {BLA, hi}
})()

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