Distributed

Output your registry as json files in a directory.

SourceOfficial

The distributed output is used for maximizing performance when serving your registry as a static asset.

Usage

jsrepo.config.ts
import { defineConfig } from "jsrepo";
import { distributed } from "jsrepo/outputs"; 

export default defineConfig({
	registry: {
		outputs: [distributed({ dir: "./public/r" })], 
	},
});

Now running jsrepo build will output your registry to the ./public/r directory.

Unlike the repository output, the distributed output will output each item as a separate json file. For example:

registry.json
button.json
utils.json

Since each item file contains all the code for all the files required for that item this is much more performant, and portable than the repository output.

On this page