aboutsummaryrefslogtreecommitdiff
path: root/docs/bundler/plugins.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/bundler/plugins.md')
-rw-r--r--docs/bundler/plugins.md22
1 files changed, 17 insertions, 5 deletions
diff --git a/docs/bundler/plugins.md b/docs/bundler/plugins.md
index 68d2b3107..c652e0583 100644
--- a/docs/bundler/plugins.md
+++ b/docs/bundler/plugins.md
@@ -63,7 +63,7 @@ console.log(config);
{% /details %}
-## Third party plugins
+## Third-party plugins
By convention, third-party plugins intended for consumption should export a factory function that accepts some configuration and returns a plugin object.
@@ -164,7 +164,7 @@ releaseYear: 2023
Note that the returned object has a `loader` property. This tells Bun which of its internal loaders should be used to handle the result. Even though we're implementing a loader for `.yaml`, the result must still be understandable by one of Bun's built-in loaders. It's loaders all the way down.
-In this case we're using `"object"`—a special loader (intended for use by plugins) that converts a plain JavaScript object to an equivalent ES module. Any of Bun's built-in loaders are supported; these same loaders are used by Bun internally for handling files of various extensions.
+In this case we're using `"object"`—a built-in loader (intended for use by plugins) that converts a plain JavaScript object to an equivalent ES module. Any of Bun's built-in loaders are supported; these same loaders are used by Bun internally for handling files of various kinds. The table below is a quick reference; refer to [Bundler > Loaders](/docs/bundler/loaders) for complete documentation.
{% table %}
@@ -175,13 +175,13 @@ In this case we're using `"object"`—a special loader (intended for use by plug
---
- `js`
-- `.js` `.mjs` `.cjs`
+- `.mjs` `.cjs`
- Transpile to JavaScript files
---
- `jsx`
-- `.jsx`
+- `.js` `.jsx`
- Transform JSX then transpile
---
@@ -210,8 +210,20 @@ In this case we're using `"object"`—a special loader (intended for use by plug
---
+- `napi`
+- `.node`
+- Import a native Node.js addon
+
+---
+
+- `wasm`
+- `.wasm`
+- Import a native Node.js addon
+
+---
+
- `object`
-- —
+- _none_
- A special loader intended for plugins that converts a plain JavaScript object to an equivalent ES module. Each key in the object corresponds to a named export.
{% /callout %}