From 3126737e6e0fdce8f58149f76ca26dd8e7d2dfbd Mon Sep 17 00:00:00 2001 From: fi3ework Date: Mon, 18 Nov 2024 20:58:30 +0800 Subject: [PATCH] docs: add plugins / output / tools --- website/docs/en/config/rsbuild/_meta.json | 11 ++- website/docs/en/config/rsbuild/output.mdx | 102 +++++++++++++++++++++ website/docs/en/config/rsbuild/plugins.mdx | 81 +++++++++++++++- website/docs/en/config/rsbuild/tools.mdx | 40 ++++++++ 4 files changed, 232 insertions(+), 2 deletions(-) diff --git a/website/docs/en/config/rsbuild/_meta.json b/website/docs/en/config/rsbuild/_meta.json index 258e26896..03c9920bb 100644 --- a/website/docs/en/config/rsbuild/_meta.json +++ b/website/docs/en/config/rsbuild/_meta.json @@ -1 +1,10 @@ -["plugins", "source", "output", "tools"] +[ + "source", + "output", + "tools", + { + "type": "file", + "name": "plugins", + "label": "plugins" + } +] diff --git a/website/docs/en/config/rsbuild/output.mdx b/website/docs/en/config/rsbuild/output.mdx index 2580f6310..b4ce5fa16 100644 --- a/website/docs/en/config/rsbuild/output.mdx +++ b/website/docs/en/config/rsbuild/output.mdx @@ -1 +1,103 @@ +import { RsbuildDocBadge } from '@components/RsbuildDocBadge'; + # output + +Configure the build outputs. + +{/* ## output.assetPrefix */} + +{/* In [production mode](https://rsbuild.dev/config/mode), use this option to set the URL prefix for static assets, such as setting it to a CDN URL. */} + +## output.charset + +The `charset` config allows you to specify the [character encoding](https://developer.mozilla.org/en-US/docs/Glossary/Character_encoding) for output files to ensure they are displayed correctly in different environments. + +## output.cleanDistPath + +Whether to clean up all files under the output directory before the build starts (the output directory defaults to `dist`). + +## output.copy + +Copies the specified file or directory to the dist directory, implemented based on [rspack.CopyRspackPlugin](https://rspack.dev/plugins/rspack/copy-rspack-plugin). + +## output.cssModules + +For custom CSS Modules configuration. + +## output.dataUriLimit + +Set the size threshold to inline static assets such as images and fonts. + +## output.distPath + +Set the directory of the dist files. Rsbuild will output files to the corresponding subdirectory according to the file type. + +{/* ## output.emitAssets */} + +{/* Control whether to emit static assets such as images, fonts, audio, video, etc. */} + +## output.emitCss + +Whether to emit CSS to the output bundles. + +## output.externals + +At build time, prevent some `import` dependencies from being packed into bundles in your code, and instead fetch them externally at runtime. + +It is important to note that `output.externals` differs from [source.alias](/config/rsbuild/source#sourcealias). Check out [source.alias](/config/rsbuild/source#sourcealias) documentation for more information. + +## output.filenameHash + +Whether to add a hash value to the filename after the production build. + +## output.filename + +Sets the filename of dist files. + +{/* ## output.injectStyles */} + +{/* Whether to inject styles into DOM. */} + +## output.inlineScripts + +Whether to inline output scripts files (.js files) into HTML with `