remix icon indicating copy to clipboard operation
remix copied to clipboard

Add `assets` middleware

Open mjackson opened this issue 2 months ago • 3 comments

The assets middleware takes a directory of files that are considered public assets for the frontend, uses them all as entry points in an esbuild context. It runs the build and serves the results when a request comes in for one of the entry points.

When env.SERVER_MODE === 'development', the assets middleware runs esbuild in watch mode to automatically rebuild as the underlying assets change.

Note: this middleware should be stable enough to use in production in environments where the application source code is available on disk.

Because of the dependency on esbuild, this middleware should probably not be part of the fetch-router package.

mjackson avatar Oct 21 '25 21:10 mjackson