@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
18 lines • 860 B
text/typescript
import type { Externals } from "../../CodeHighlighter/types.mjs";
/**
* Returns true when `modulePath` is unambiguously a server-only module:
* - the literal `server-only` package
* - any `node:*` import
* - any unprefixed Node.js built-in (e.g. `fs`, `path`, `child_process`)
*/
export declare function isServerOnlyModule(modulePath: string): boolean;
/**
* Inspects collected externals and returns the list of module paths that are
* server-only. An empty array means the demo's dependencies are safe to inline
* into the client bundle.
*
* Pass the unfiltered externals (i.e. before `filterRuntimeExternals`) so that
* side-effect imports like `import 'server-only';` — which have no bound names
* and would otherwise be dropped — are still detected.
*/
export declare function findServerOnlyExternals(externals: Externals): string[];