add await to Bun.plugin(...) (#9665)

This commit is contained in:
Stefan Buhrmester
2024-03-28 00:47:40 +01:00
committed by GitHub
parent 9f20d40678
commit fcd7b01dba

View File

@@ -63,7 +63,7 @@ Plugins are primarily used to extend Bun with loaders for additional file types.
```ts#yamlPlugin.ts
import { plugin } from "bun";
plugin({
await plugin({
name: "YAML",
async setup(build) {
const { load } = await import("js-yaml");
@@ -179,7 +179,7 @@ Loading a YAML file is useful, but plugins support more than just data loading.
```ts#sveltePlugin.ts
import { plugin } from "bun";
plugin({
await plugin({
name: "svelte loader",
async setup(build) {
const { compile } = await import("svelte/compiler");