中文文档
参与贡献
投票
博客
English
中文
한국어
API
概念
配置
指南
loader
迁移
plugin
webpack
api
简介
命令行接口(CLI)
Node 接口
Stats Data
webpack-dev-server API
Hot Module Replacement
Loader Interface
Logger 接口
模块方法
Module Variables
Compilation Object
compiler 钩子
compilation 钩子
ContextModuleFactory Hooks
JavascriptParser Hooks
NormalModuleFactory Hooks
Plugin API
解析器(Resolvers)
blog
Blog
Roadmap 2021 (2020-12-08)
Webpack 5 发布 (2020-10-10)
概念
概念
入口起点(entry points)
输出(output)
loader
plugin
配置(Configuration)
模块(Modules)
模块解析(Module Resolution)
Module Federation
依赖图(dependency graph)
target
manifest
模块热替换(hot module replacement)
为什么选择 webpack
揭示内部原理
配置
配置
Configuration Languages
Configuration Types
入口和上下文
模式(Mode)
Output
Module
解析(Resolve)
优化(Optimization)
插件(Plugins)
DevServer
Cache
Devtool
构建目标(Targets)
watch 和 watchOptions
外部扩展(Externals)
Performance
Node
Stats 对象
实验特性(Experiments)
其它选项
contribute
参与贡献
作者指引
编写 loader
自定义插件
插件模式
发布流程
调试
指南
指南
起步
管理资源
管理输出
开发环境
代码分离
缓存
创建库
环境变量
构建性能
内容安全策略
开发 - Vagrant
依赖管理
安装
模块热替换
Tree Shaking
生产环境
懒加载
ECMAScript 模块
Shimming 预置依赖
TypeScript
Web Workers
渐进式网络应用程序
公共路径
集成
资源模块
entry 高级用法
Package exports
loader
Loaders
babel-loader
coffee-loader
css-loader
exports-loader
expose-loader
html-loader
imports-loader
less-loader
node-loader
postcss-loader
pug-loader
remark-loader
sass-loader
source-map-loader
style-loader
stylus-loader
thread-loader
val-loader
迁移
Migrate
从 v4 升级到 v5
To v4 from v3
从 v1 升级到 v2 或 v3
plugin
插件
HtmlWebpackPlugin
AutomaticPrefetchPlugin
BannerPlugin
CommonsChunkPlugin
ContextExclusionPlugin
ContextReplacementPlugin
DefinePlugin
DllPlugin
EnvironmentPlugin
EvalSourceMapDevToolPlugin
HashedModuleIdsPlugin
HotModuleReplacementPlugin
IgnorePlugin
Internal webpack plugins
LimitChunkCountPlugin
MinChunkSizePlugin
ModuleConcatenationPlugin
ModuleFederationPlugin
NoEmitOnErrorsPlugin
NormalModuleReplacementPlugin
PrefetchPlugin
ProfilingPlugin
ProgressPlugin
ProvidePlugin
SourceMapDevToolPlugin
SplitChunksPlugin
WatchIgnorePlugin
CompressionWebpackPlugin
CopyWebpackPlugin
CssMinimizerWebpackPlugin
EslintWebpackPlugin
HtmlMinimizerWebpackPlugin
ImageMinimizerWebpackPlugin
InstallWebpackPlugin
JsonMinimizerWebpackPlugin
MiniCssExtractPlugin
StylelintWebpackPlugin
TerserWebpackPlugin
Comparison
Awesome webpack
品牌指南
术语表
遵循许可
Webpack 5
Webpack 4
Print Section
配置
使用不同的配置文件
设置一个新的 webpack 项目
Configuration Languages
TypeScript
CoffeeScript
Babel and JSX
Configuration Types
导出函数
导出 Promise
导出多种配置
dependencies
parallelism
入口和上下文
context
entry
Naming
Entry descriptor
Output filename
Dependencies
Dynamic entry
模式(Mode)
用法
Mode: development
Mode: production
Mode: none
Output
assetModuleFilename
asyncChunks
auxiliaryComment
charset
chunkFilename
chunkFormat
chunkLoadTimeout $#outputchunkLoadtimeout$
chunkLoadingGlobal
chunkLoading
clean
compareBeforeEmit
crossOriginLoading
devtoolFallbackModuleFilenameTemplate
devtoolModuleFilenameTemplate
devtoolNamespace
enabledChunkLoadingTypes
enabledLibraryTypes
enabledWasmLoadingTypes
filename
Template strings
globalObject
hashDigest
hashDigestLength
hashFunction
hashSalt
hotUpdateChunkFilename
hotUpdateGlobal
hotUpdateMainFilename
iife
importFunctionName
library
output.library.name
output.library.type
output.library.export
output.library.auxiliaryComment
output.library.umdNamedDefine
libraryExport
libraryTarget
暴露为一个变量
通过在对象上赋值暴露
模块定义系统
其他 Targets
module
path
pathinfo
publicPath
scriptType
sourceMapFilename
sourcePrefix
strictModuleErrorHandling
strictModuleExceptionHandling
trustedTypes
umdNamedDefine
uniqueName
wasmLoading
workerChunkLoading
Module
generator
parser
module.parser.javascript
noParse
unsafeCache
rules
Rule
Rule 条件
Rule 结果
嵌套的 Rule
Rule.enforce
Rule.exclude
Rule.include
Rule.issuer
Rule.issuerLayer
Rule.layer
Rule.loader
Rule.loaders
Rule.mimetype
Rule.oneOf
Rule.options / Rule.query
Rule.parser
Rule.parser.dataUrlCondition
Rule.generator
Rule.generator.dataUrl
Rule.generator.emit
Rule.generator.filename
Rule.generator.publicPath
Rule.generator.outputPath
Rule.resource
Rule.resourceQuery
Rule.parser.parse
Rule.rules
Rule.scheme
Rule.sideEffects
Rule.test
Rule.type
Rule.use
Rule.resolve
resolve.fullySpecified
Condition
UseEntry
模块上下文(Module Contexts)
解析(Resolve)
resolve
resolve.alias
resolve.aliasFields
resolve.cacheWithContext
resolve.conditionNames
resolve.descriptionFiles
resolve.enforceExtension
resolve.extensionAlias
resolve.extensions
resolve.fallback
resolve.mainFields
resolve.mainFiles
resolve.exportsFields
resolve.modules
resolve.unsafeCache
resolve.useSyncFileSystemCalls
resolve.plugins
resolve.preferRelative
resolve.preferAbsolute
resolve.symlinks
resolve.cachePredicate
resolve.restrictions
resolve.roots
resolve.importsFields
resolve.byDependency
resolveLoader
优化(Optimization)
optimization.chunkIds
optimization.concatenateModules
optimization.emitOnErrors
optimization.flagIncludedChunks
optimization.innerGraph
optimization.mangleExports
optimization.mangleWasmImports
optimization.mergeDuplicateChunks
optimization.minimize
optimization.minimizer
optimization.moduleIds
optimization.nodeEnv
optimization.portableRecords
optimization.providedExports
optimization.realContentHash
optimization.removeAvailableModules
optimization.removeEmptyChunks
optimization.runtimeChunk
optimization.sideEffects
optimization.splitChunks
optimization.usedExports
插件(Plugins)
plugins
DevServer
devServer
Usage via CLI
Usage via API
allowedHosts
bonjour
client
logging
overlay
progress
reconnect
webSocketTransport
webSocketURL
compress
devMiddleware
http2
https
headers
historyApiFallback
host
local-ip
local-ipv4
local-ipv6
hot
ipc
liveReload
magicHtml
onAfterSetupMiddleware
onBeforeSetupMiddleware
onListening
open
port
proxy
server
setupExitSignals
setupMiddlewares
static
directory
staticOptions
publicPath
serveIndex
watch
watchFiles
webSocketServer
Cache
cache
cache.allowCollectingMemory
cache.buildDependencies
cache.cacheDirectory
cache.cacheLocation
cache.cacheUnaffected
cache.compression
cache.hashAlgorithm
cache.idleTimeout
cache.idleTimeoutAfterLargeChanges
cache.idleTimeoutForInitialStore
cache.managedPaths
cache.maxAge
cache.maxGenerations
cache.maxMemoryGenerations $#cachemaxMemorygenerations$
cache.memoryCacheUnaffected
cache.name
cache.profile
cache.store
cache.type
cache.version
在 CI/CD 系统中设置缓存
GitLab CI/CD
Github actions
Devtool
devtool
品质说明(quality)
对于开发环境
特定场景
对于生产环境
构建目标(Targets)
target
string
[string]
false
watch 和 watchOptions
watch
watchOptions
watchOptions.aggregateTimeout
watchOptions.ignored
watchOptions.poll
watchOptions.followSymlinks
watchOptions.stdin
故障排除
发现修改,但并未做处理
没有足够的文件观察者
macOS fsevents Bug
Windows Paths
Vim
在 WebStorm 中保存
外部扩展(Externals)
externals
字符串
[string]
对象
函数
RegExp
混用语法
byLayer
externalsType
externalsType.commonjs
externalsType.global
externalsType.module
externalsType.node-commonjs
externalsType.promise
externalsType.self
externalsType.script
externalsType.this
externalsType.var
externalsType.window
externalsPresets
Performance
performance
performance.assetFilter
performance.hints
performance.maxAssetSize
performance.maxEntrypointSize
Node
node
global
__filename
__dirname
Stats 对象
Stats Presets
Stats
stats.all
stats.assets
stats.assetsSort
stats.builtAt
stats.moduleAssets
stats.assetsSpace
stats.modulesSpace
stats.chunkModulesSpace
stats.nestedModules
stats.nestedModulesSpace
stats.cached
stats.cachedModules
stats.runtimeModules
stats.dependentModules
stats.groupAssetsByChunk
stats.groupAssetsByEmitStatus
stats.groupAssetsByExtension
stats.groupAssetsByInfo
stats.groupAssetsByPath
stats.groupModulesByAttributes
stats.groupModulesByCacheStatus
stats.groupModulesByExtension
stats.groupModulesByLayer
stats.groupModulesByPath
stats.groupModulesByType
stats.groupReasonsByOrigin
stats.cachedAssets
stats.children
stats.chunks
stats.chunkGroups
stats.chunkModules
stats.chunkOrigins
stats.chunksSort
stats.context
stats.colors
stats.depth
stats.entrypoints
stats.env
stats.orphanModules
stats.errors
stats.errorDetails
stats.errorStack
stats.excludeAssets
stats.excludeModules
stats.exclude
stats.hash
stats.logging
stats.loggingDebug
stats.loggingTrace
stats.modules
stats.modulesSort
stats.moduleTrace
stats.optimizationBailout
stats.outputPath
stats.performance
stats.preset
stats.providedExports
stats.errorsCount
stats.warningsCount
stats.publicPath
stats.reasons
stats.reasonsSpace
stats.relatedAssets
stats.source
stats.timings
stats.ids
stats.usedExports
stats.version
stats.chunkGroupAuxiliary
stats.chunkGroupChildren
stats.chunkGroupMaxAssets
stats.warnings
stats.warningsFilter
stats.chunkRelations
字段排序
扩展统计信息行为
实验特性(Experiments)
experiments
experiments.backCompat
experiments.buildHttp
experiments.css
experiments.cacheUnaffected
experiments.futureDefaults
experiments.lazyCompilation
experiments.outputModule
其它选项
amd
bail
dependencies
ignoreWarnings
infrastructureLogging
appendOnly
colors
console
debug
level
stream
loader
name
parallelism
profile
recordsInputPath
recordsOutputPath
recordsPath
snapshot
buildDependencies
immutablePaths
managedPaths
managedPaths
module
resolve
resolveBuildDependencies
解析(Resolve)
编辑此页
·
打印文档
« Previous
Module
Next »
优化(Optimization)