Skip to content

Configuration

Aritra Karak edited this page Oct 14, 2023 · 2 revisions

Configuring hyperimport doesn't require any extra config file. It can be done directly in bunfig.toml already created earlier. Simply add the [hyperimport] section there and add your configuration below it.

[hyperimport]
loaders = ["rs"]
custom = ["./myLoader.ts"]
debug = true

loaders: []string

Built-in loaders to be used for loading various languages.

Currently the following loaders are available built-in with more to be added later.

  • library: Library loader to load .so or .dylib shared library files.
  • rs: Rust loader to load .rs files.
  • zig: Zig loader to load .zig files.

Warning

Mutiple loaders will increase startup time for your script. Make sure to only use what you need.

custom: []string

Paths to custom loaders for other languages or even scripts which export a default class containing a toPlugin() which returns a BunPlugin object that will be consumed by hyperimport to register it allowing you to register every kind of plugin.

Warning

Mutiple custom loaders will increase startup time for your script. Make sure to only use what you need.

debug: boolean

Enables or disables debug mode. Disabled by default. When enabled, hyperimport logs it's internal actions useful for debugging unknown behavior.

Clone this wiki locally