Describe the feature
Previous discussion in nitrojs/nitro#1757 (@dargmuesli) and attempt in nitrojs/nitro#1840 (by @HigherOrderLogic)
We might support optional inline|bundle|offline: true to inline rendered HTML assets, making it offline-friendly.
I am thinking we could alternatively use fetch (server side) to directly fetch and globalThis.process?.getBuiltInModule?.('node:fs') (optional runtime requirement available in Node/Deno/Bun) to allow caching the result.
This way we can keep the library fully web-compliant and agnostic, also it might work for all 3 renderer variants (we only somehow need a search and inline logic).
Alternative would be using optional peer dependencies and dynamic import (likely a new export subpath in a way to avoid bundlers eagerly statically analyzing them) -- we also need bundled variant from all 3 current supported renderers or it will be partial.
(PR welcome if someone wants to take this)
Describe the feature
Previous discussion in nitrojs/nitro#1757 (@dargmuesli) and attempt in nitrojs/nitro#1840 (by @HigherOrderLogic)
We might support optional
inline|bundle|offline: trueto inline rendered HTML assets, making it offline-friendly.I am thinking we could alternatively use
fetch(server side) to directly fetch andglobalThis.process?.getBuiltInModule?.('node:fs')(optional runtime requirement available in Node/Deno/Bun) to allow caching the result.This way we can keep the library fully web-compliant and agnostic, also it might work for all 3 renderer variants (we only somehow need a search and inline logic).
Alternative would be using optional peer dependencies and dynamic import (likely a new export subpath in a way to avoid bundlers eagerly statically analyzing them) -- we also need bundled variant from all 3 current supported renderers or it will be partial.
(PR welcome if someone wants to take this)