logo
指南
配置
插件
API
English
简体中文
GitHub
Twitter
Discord
指南
配置
插件
API
English
简体中文
GitHub
Twitter
Discord
logo
Overview
plugins

dev

assetPrefix
beforeStartUrl
client
hmr
progressBar
setupMiddlewares
startUrl
writeToDisk

source

aliasStrategy
alias
define
entry
exclude
include
preEntry
transformImport

output

assetPrefix
charset
cleanDistPath
copy
cssModules
dataUriLimit
disableFilenameHash
disableMinimize
distPath
externals
filename
injectStyles
inlineScripts
inlineStyles
legalComments
overrideBrowserslist
polyfill
sourceMap
targets

html

appIcon
crossorigin
favicon
inject
meta
mountId
outputStructure
scriptLoading
tags
templateParameters
template
title

server

compress
headers
historyApiFallback
host
htmlFallback
https
port
proxy
publicDir
strictPort

tools

autoprefixer
bundlerChain
cssLoader
htmlPlugin
less
postcss
rspack
sass
styleLoader

performance

bundleAnalyze
chunkSplit
dnsPrefetch
preconnect
prefetch
preload
printFileSize
profile
removeConsole
removeMomentLocale

host#

  • 类型: string
  • 默认值: 0.0.0.0

指定 Rsbuild Server 启动时监听的 host。

默认情况下,Rsbuild Server 会监听 0.0.0.0,这代表监听所有的网络接口,包括 localhost 和公网地址。

你可以使用 server.host 配置或 --host 参数来指定 host (--host 参数的优先级高于 server.host 配置)。

如果你希望 Rsbuild Server 只监听 localhost,可以设置为:

export default {
  server: {
    host: 'localhost',
  },
};
Edit this page on GitHub
上一页historyApiFallback
下一页htmlFallback
目录