Setup

This field can be used to execute JavaScript before an import is loaded. This is occasionally necessary to allow libraries to load correctly if they have misconfigured module wrappers, or expect some global definition that is unavailable in the local context.

Example

This type doesn't render any UI.
{
  type: "setup",
  value: () => {
    exports = {}
  },
}

Options

Input

Use these options when using the field with take.

value
string
A JavaScript function that runs before imports load.

Data

Setup does not return any value and isn’t present in the data passed to make.