diff options
author | 2023-05-05 12:53:38 -0700 | |
---|---|---|
committer | 2023-05-05 12:53:38 -0700 | |
commit | 386639a4c5049862b7ceb1522ea1512ac8f9a43f (patch) | |
tree | 63cd2e0bbb21b7a7b1054dd83127e5a1692ff45b /docs/bundler/plugins.md | |
parent | d9386a68a4316052f355235a7ff4f4b5eb0a2722 (diff) | |
download | bun-386639a4c5049862b7ceb1522ea1512ac8f9a43f.tar.gz bun-386639a4c5049862b7ceb1522ea1512ac8f9a43f.tar.zst bun-386639a4c5049862b7ceb1522ea1512ac8f9a43f.zip |
Start esbuild migration guide. More docs. (#2787)
* Bundler docs updates. Start esbuild migration guide.
* Updates
* Add JS API comp
* Tweaks
* Updates
* Updates
* Updates
Diffstat (limited to 'docs/bundler/plugins.md')
-rw-r--r-- | docs/bundler/plugins.md | 22 |
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 %} |