Skip to content

remix/assets · Type

View Source

ModuleLoader

Summary

Synchronously loads a module or delegates to the next configured loader.

Loaders follow Node's synchronous load hook signature and chaining contract. The asset server passes them JavaScript after its TypeScript/JavaScript transform and before HMR analysis and minification. Each loader must delegate to nextLoad or return shortCircuit: true.

Signature

type ModuleLoader = (
  url: string,
  context: ModuleLoadContext,
  nextLoad: NextModuleLoader,
) => ModuleLoadResult