[]previous and next page

Server-only and client-only markers

import "server-only" marks a module as server code.

For agentsUpdated

import "server-only" marks a module as server code. When the browser's module graph reaches it, the build fails with [IMPORT_PROTECTED] and the import chain, as it does for a *.server.* file. import "client-only" marks browser code: a server module that names it fails the build the same way. Dusk reads these as specifiers only. Nothing needs to be installed, and an installed copy of either package is ignored, so the markers work with no dependency. The file conventions (*.server.*, *.client.*) and importProtection globs are unchanged.