中文文档
参与贡献
投票
博客
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
简介
CLI
模块
Node
Loaders
插件
命令行接口(CLI)
命令
Build
Init
Loader
Plugin
Info
Configtest
Serve
Watch
Flags
Negated Flags
核心 Flags
用法
使用配置文件
不使用配置文件
默认配置
通用配置
help
version
config
config-name
merge
json
Environment 选项
env
node-env
配置选项
分析 Bundle
Progress
将 CLI 参数传递给 Node.js
退出代码及其含义
CLI 环境变量
WEBPACK_PACKAGE
Troubleshooting
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ./webpack.config.ts
Node 接口
安装(Installation)
webpack()
Compiler 实例(Compiler Instance)
执行(Run)
监听(Watching)
关闭 Watching (Close Watching)
Invalidate Watching
Stats 对象(Stats Object)
stats.hasErrors()
stats.hasWarnings()
stats.toJson(options)
stats.toString(options)
MultiCompiler
错误处理(Error Handling)
自定义文件系统(Custom File Systems)
Stats Data
配置结构(Structure)
Asset 对象
Chunk 对象
Module 对象
Entry 对象
错误和告警信息
webpack-dev-server API
Installation
start
startCallback(callback)
stop
stopCallback(callback)
internalIP(family: "v4" | "v6")
internalIPSync(family: "v4" | "v6")
Hot Module Replacement
模块 API
accept
accept (self)
decline
decline (self)
dispose (or addDisposeHandler)
invalidate
removeDisposeHandler
API 管理
status
check
apply
addStatusHandler
removeStatusHandler
Loader Interface
示例
同步 Loaders
异步 Loaders
"Raw" Loader
Pitching Loader
The Loader Context
loader 上下文示例
this.addContextDependency
this.addDependency
this.addMissingDependency
this.async
this.cacheable
this.callback
this.clearDependencies
this.context
this.data
this.emitError
this.emitFile
this.emitWarning
this.fs
this.getOptions(schema)
this.getResolve
this.hot
this.importModule
this.loaderIndex
this.loadModule
this.loaders
this.mode
this.query
this.request
this.resolve
this.resource
this.resourcePath
this.resourceQuery
this.rootContext
this.sourceMap
this.target
this.utils
this.version
this.webpack
Webpack 特有属性
this._compilation
this._compiler
过时的上下文属性
this.debug
this.inputValue
this.minimize
this.value
this._module
错误报告
Inline matchResource
Logging
Logger 接口
Examples of how to get and use webpack logger in loaders and plugins
Logger methods
Runtime Logger API
Modules
模块方法
ES6 (推荐)
import
export
import()
import() 中的表达式
CommonJS
require
require.resolve
require.cache
require.ensure
AMD
define (with factory)
define (with value)
require (amd-version)
标签模块(Labeled Modules)
export label
require label
Webpack
require.context
require.include
require.resolveWeak
warning
Module Variables
module.loaded (NodeJS)
module.hot (webpack-specific)
module.id (CommonJS)
module.exports (CommonJS)
exports (CommonJS)
global (NodeJS)
__dirname (NodeJS)
import.meta.url
import.meta.webpack
import.meta.webpackHot
import.meta.webpackContext
__filename (NodeJS)
__resourceQuery (webpack-specific)
__webpack_public_path__ (webpack-specific)
__webpack_require__ (webpack-specific)
__webpack_chunk_load__ (webpack-specific)
__webpack_module__ (webpack-specific)
__webpack_module__.id (webpack-specific)
__webpack_modules__ (webpack-specific)
__webpack_hash__ (webpack-specific)
__webpack_get_script_filename__ (webpack-specific)
__non_webpack_require__ (webpack-specific)
__webpack_exports_info__ (webpack-specific)
__webpack_is_included__ (webpack-specific)
__webpack_base_uri__ (webpack-specific)
__webpack_runtime_id__
DEBUG (webpack-specific)
Objects
Compilation Object
compilation 对象方法
getStats
addModule
getModule
findModule
buildModule
processModuleDependencies
addEntry
rebuildModule
finish
seal
unseal
reportDependencyErrorsAndWarnings
addChunkInGroup
addChunk
assignDepth
getDependencyReference
processDependenciesBlocksForChunkGroups
removeReasonsOfDependencyBlock
patchChunksAfterReasonRemoval
removeChunkFromDependencies
sortItemsWithChunkIds
summarizeDependencies
createHash
createModuleAssets
createChunkAssets
getPath
getPathWithInfo
createChildCompiler
checkConstraints
emitAsset
updateAsset
deleteAsset
getAssets
getAsset
Plugins
compiler 钩子
监听(watching)
钩子
environment
afterEnvironment $#afterEnvironment$
entryOption
afterPlugins
afterResolvers
initialize
beforeRun
run
watchRun
normalModuleFactory
contextModuleFactory
beforeCompile
compile
thisCompilation
compilation
make
afterCompile
shouldEmit
emit
afterEmit
assetEmitted
done
additionalPass
failed
invalid
watchClose
shutdown
infrastructureLog
log
compilation 钩子
buildModule
rebuildModule
failedModule
succeedModule
finishModules
finishRebuildingModule
seal
unseal
optimizeDependencies
afterOptimizeDependencies
optimize
optimizeModules
afterOptimizeModules
optimizeChunks
afterOptimizeChunks
optimizeTree
afterOptimizeTree
optimizeChunkModules
afterOptimizeChunkModules
shouldRecord
reviveModules
beforeModuleIds
moduleIds
optimizeModuleIds
afterOptimizeModuleIds
reviveChunks
beforeChunkIds
chunkIds
optimizeChunkIds
afterOptimizeChunkIds
recordModules
recordChunks
beforeModuleHash
afterModuleHash
beforeHash
afterHash
recordHash
record
beforeModuleAssets
additionalChunkAssets
shouldGenerateChunkAssets
beforeChunkAssets
additionalAssets
optimizeChunkAssets
afterOptimizeChunkAssets
optimizeAssets
afterOptimizeAssets
processAssets
afterProcessAssets
needAdditionalSeal
afterSeal
chunkHash
moduleAsset
chunkAsset
assetPath
needAdditionalPass
childCompiler
normalModuleLoader
ContextModuleFactory Hooks
beforeResolve
afterResolve
contextModuleFiles
alternativeRequests
JavascriptParser Hooks
钩子
evaluateTypeof
evaluate
evaluateIdentifier
evaluateDefinedIdentifier
evaluateCallExpressionMember
statement
statementIf
label
import
importSpecifier
export
exportImport
exportDeclaration
exportExpression
exportSpecifier
exportImportSpecifier
varDeclaration
varDeclarationLet
varDeclarationConst
varDeclarationVar
canRename
rename
assigned
assign
typeof
call
callMemberChain
new
expression
expressionConditionalOperator
program
NormalModuleFactory Hooks
beforeResolve
factorize
resolve
resolveForScheme
afterResolve
createModule
module
createParser
parser
createGenerator
generator
Plugin API
Tapable
插件类型
自定义钩子
进度报告
日志
下一步
解析器(Resolvers)
类型
配置选项
NormalModuleFactory Hooks
编辑此页
·
打印文档
« Previous
JavascriptParser Hooks
Next »
Plugin API