diff options
author | 2023-02-25 22:47:11 +0700 | |
---|---|---|
committer | 2023-02-25 09:47:11 -0600 | |
commit | 8e09b1afff0e2e147a59324114a03e5b47213007 (patch) | |
tree | e323b300f35f60c3de86b82f43df96d81af55246 /docs/runtime/plugins.md | |
parent | cf7a09c0d31d160976bdf349c389e6992664b487 (diff) | |
download | bun-8e09b1afff0e2e147a59324114a03e5b47213007.tar.gz bun-8e09b1afff0e2e147a59324114a03e5b47213007.tar.zst bun-8e09b1afff0e2e147a59324114a03e5b47213007.zip |
docs: improved language in yaml loader example (#2172)
* docs: improved language in yaml loader example
* docs(api/http): fix typo
* docs(api/spawn): fix typo
* docs(api/transpiler): fix typo
Diffstat (limited to 'docs/runtime/plugins.md')
-rw-r--r-- | docs/runtime/plugins.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/runtime/plugins.md b/docs/runtime/plugins.md index c19ea9145..de8885507 100644 --- a/docs/runtime/plugins.md +++ b/docs/runtime/plugins.md @@ -79,7 +79,7 @@ plugin({ <!-- Internally, Bun's transpiler automatically turns `plugin()` calls into separate files (at most 1 per file). This lets loaders activate before the rest of your application runs with zero configuration. --> -Plugins are primarily used to extend Bun with loaders for additional file types. Let's look at a simple plugin that exposes envLet's look at a sample plugin that implements a loader for `.yaml` files. +Plugins are primarily used to extend Bun with loaders for additional file types. Let's look at a simple plugin that implements a loader for `.yaml` files. ```ts#yamlPlugin.ts import { plugin } from "bun"; @@ -179,7 +179,7 @@ In this case we're using `"object"`—a special loader (intended for use by plug {% /callout %} -Loading a YAML file is useful, but plugins support more than just data loading. Lets look at a plugin that lets Bun import `*.svelte` files. +Loading a YAML file is useful, but plugins support more than just data loading. Let's look at a plugin that lets Bun import `*.svelte` files. ```ts#sveltePlugin.ts import { plugin } from "bun"; @@ -234,7 +234,7 @@ type PluginBuilder = { onLoad: ( args: { filter: RegExp; namespace?: string }, callback: (args: { path: string }) => { - loader?: "js" | "jsx" | "ts" | "tsx" | "json" | "yaml" | "object"; + loader?: "js" | "jsx" | "ts" | "tsx" | "json" | "toml" | "object"; contents?: string; exports?: Record<string, any>; }, |