The source code of the module
Symbol
OnLoadResult
type OnLoadResult = OnLoadResultSourceCode | OnLoadResultObject | undefined | void
Referenced types
interface OnLoadResultSourceCode
interface OnLoadResultObject
- exports: Record<string, unknown>
The object to use as the module
// In your loader builder.onLoad({ filter: /^hello:world$/ }, (args) => { return { exports: { foo: "bar" }, loader: "object" }; }); // In your script import {foo} from "hello:world"; console.log(foo); // "bar"