Skip to content

Map paths to import roots in Rhai.toml #80

Description

@schungx

Some users may organize their module scripts directly under the source directory, but resolve them into different paths at runtime.

For example, if we have:

src/
  main.rhai
  modules/
    foo/
      baz/
        main.rhai
    bar/
      main.rhai

During runtime, the user may want imports to work this way:

import "baz" as baz;
import "bar" as bar;

So can something like this be put into Rhai.toml:

[modules]
foo = "./modules/foo"
bar = "./modules/bar"
baz = "./modules/foo/baz"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions