bundle your
assets scripts

dependency bundling graphic

编写代码

app.js

import bar from './bar';

bar();

bar.js

export default function bar() {
  //
}

使用 webpack 打包

webpack.config.js

module.exports = {
  entry: './app.js',
  output: {
    filename: 'bundle.js'
  }
}

page.html

<html>
  <head>
    ...
  </head>
  <body>
    ...
    <script src="bundle.js"></script>
  </body>
</html>

然后在命令行运行 webpack 就会创建 bundle.js

让一切变得简单

立即开始更多关于 webpack 核心概念的高级信息,请通过快速查阅指南部分,或深入概念部分来了解。

支持团队

通过你的贡献、捐款或者赞助,webpack 将获得繁荣发展。你的捐助直接用于支持我们付出工作、持续改进,最加重要的是有助于我们提供优秀的文档和资料!

平台赞助

platinum sponsorsare those who have pledged $50000 or more to webpack.

金牌赞助

gold sponsorsare those who have pledged $10000 to $50000 to webpack.

银牌赞助

silver sponsorsare those who have pledged $2000 to $10000 to webpack.

avatar

铜牌赞助

bronze sponsorsare those who have pledged up to $2000 to webpack.

dafeng's avatarsentry's avatarfrontendmasters's avatarvtex's avatarphotoeditorsdk's avatarxteam's avatarwebflow's avatarpeerigon's avatarsebastiansoft's avatarjfellner's avatarkentcdodds's avataralligatorio's avatarjaredpalmer's avatarwaffleio's avatarzeit's avatarrollbar's avatarsoftwareplant's avataryvoschaap's avatarstickermule's avatarsarah_edo's avataraddyosmani's avatarmoduscreate's avatarmichellemcfarland's avatarhubspot's avataraccelebrate's avataricons8's avataralunny's avatarjoshuawiens's avatarrebuy's avatarcontact4's avataralgolia's avatarthetrainingadvisors's avatarep's avatarappfolio's avatarn26's avatarproductreview's avatarArchitects.ioclayglobal's avatarworkco's avatarreactnativetraining's avatardanabramov's avatarchristianalfoni's avatarirvinwaldman's avatarben2's avataridonethis's avatarjjwonmin's avatarevgenyrodionov's avataravatar

赞助者

The following Backers are individuals who have contributed various amounts of money in order to help support webpack. Every little bit helps, and we appreciate even the smallest contributions.

angular's avatar
kossnocorp's avatar
matteocng's avatar
ericclemmons's avatar
mhpoin's avatar
sjricc's avatar
nicolaskroos's avatar
esjacobs's avatar
kevinjames's avatar
darkokukovec's avatar
housecor's avatar
openlistings's avatar
_seanclayton's avatar
albertwchang's avatar
micropyramid's avatar
jseidel's avatar
gs's avatar
oliverzeigermann's avatar
jeantimex's avatar
linkoivan's avatar
email's avatar
alexliang's avatar
adamrecvlohe's avatar
seanlarkin's avatar
alexleung's avatar
shaneckel's avatar
ragunathramaswamy's avatar
reybango's avatar
sprjr's avatar
dshills's avatar
jorgeantunes's avatar
evgenijsafronov's avatar
rjun07a's avatar
derk-jan's avatar
omt-tech's avatar
alex11's avatar
adamrackis's avatar
sayyupnl's avatar
hello2's avatar
usirin's avatar
rafalfilipek's avatar
joelchen's avatar
gilbarbara's avatar
felipedeamorim's avatar
simenbrekken's avatar
jeremyschlatter's avatar
stillconor's avatar
iamstarkov's avatar
jkimbo's avatar
wellcco's avatar
damlemail's avatar
karolisastrauka's avatar
ggrgur's avatar
dzello's avatar
mark4's avatar
tylermcginnis's avatar
michaelvandiest's avatar
ching-tingwu's avatar
travisarnold's avatar
alejandrob's avatar
eliseumds1's avatar
eduardkyvenko's avatar
me17's avatar
memosanchez's avatar
threepointone's avatar
james3's avatar
simonkjellberg's avatar
bruno12mota's avatar
suhasdeshpande's avatar
danieltian's avatar
ajitsonlion's avatar
webpack1's avatar
jacobpeddicord's avatar
snolflake's avatar
loklaan's avatar
franciscobueno's avatar
jacobmischka's avatar
jasonlaster11's avatar
arthurstolyar's avatar
deanpogni's avatar
marcusnielsen's avatar
jzelez's avatar
aarontrostle's avatar
nevenrodic's avatar
eddyhernandez's avatar
adamegesa's avatar
_sashashakun's avatar
shekadzianis's avatar
mejdinhlife's avatar
jslauthor's avatar
nicolaigrosser's avatar
tdmckinn's avatar
hellbeast92's avatar
_azayzel's avatar
tluenborg's avatar
pushred's avatar
jonasstromsodd's avatar
twobucks's avatar
taopaic's avatar
nickadeemus2002's avatar
ayastreb's avatar
iam's avatar
emarticor's avatar
jwebe0pe's avatar
cfreemancode's avatar
silvenon's avatar
gaelmarziou's avatar
marknv1991's avatar
aerohitk's avatar
frenchtoastrllc's avatar
ebaranovdev's avatar
parkerbond's avatar
andreypopp's avatar
webdesserts's avatar
pavelkornev's avatar
kurtiskemple's avatar
zemgalis's avatar
danjasnowski's avatar
claudiordgz's avatar
sumandna's avatar
dominikrodler's avatar
markusdrake's avatar
v7rulnik's avatar
kuma's avatar
aripalo's avatar
keithito's avatar
mrjoelkemp's avatar
andreicek's avatar
kevinmaes's avatar
jan-kantypawelski's avatar
martinkammersberger's avatar
bentlegen's avatar
richardworsfold's avatar
philippeleger's avatar
nathanhunzaker's avatar
ameyakoshti's avatar
colinwrenca's avatar
blade0r's avatar
kevin's avatar
oieduardorabelo's avatar
manuelbieh's avatar
jakewilliams's avatar
davidjungst's avatar
danieltreasure's avatar
kennethbrubaker's avatar
mukeshsoni's avatar
kostasmanionis's avatar
guilhermerodrigues's avatar
Rafachon's avatar
tranvu's avatar
gregvenech's avatar
rexxars's avatar
mpalmer_'s avatar
selcukkiraz's avatar
rude's avatar
santerihiltunen's avatar
ridermansb's avatar
jlgeering16's avatar
giovanni0918's avatar
pheuter's avatar
viestursteivans's avatar
hello6's avatar
bhargavponnapalli's avatar
aarongodin's avatar
jreem's avatar
kanitkornk's avatar
pruett's avatar
craigdoremus's avatar
timberio's avatar
sergeysharov's avatar
endel's avatar
hozefaj's avatar
sboulade's avatar
arturkulig's avatar
benmccormick's avatar
dmh's avatar
corjen's avatar
miclo's avatar
rauban's avatar
xiplias's avatar
jsdotcr's avatar
carlosepp's avatar
markthethomas's avatar
morrelljeremy's avatar
molokovev's avatar
getbyteswag's avatar
alexmost1989's avatar
relekang's avatar
gabeldeluxe's avatar
reznord's avatar
wrumyl's avatar
pepibumur's avatar
knovour's avatar
info17's avatar
423300's avatar
harunhasdal's avatar
darrenscerri's avatar
karannijhawan's avatar
leonidasesteban's avatar
joewoojin's avatar
arturptaszek's avatar
andrewbrown's avatar
kaven276's avatar
josemaenzo's avatar
mikejoyce's avatar
krofdrakula's avatar
fravic's avatar
marklozano's avatar
timgriesser's avatar
calesce's avatar
mikeauclair's avatar
psulek's avatar
jeevanpalakurty's avatar
ngt_consulting's avatar
13web-avenue's avatar
mail6's avatar
zward84's avatar
timoshenkoevgeny's avatar
ryandrewjohnson's avatar
a's avatar
chris's avatar
geoyws's avatar
code's avatar
andreaskeller's avatar
ddwag1's avatar
johan's avatar
musito's avatar
altruity's avatar
zjammal's avatar
radojesrb's avatar
spentacular's avatar
lukeeeebennettplus's avatar
genechulkov's avatar
kevinortman's avatar
erichfeng's avatar
spjulien's avatar
happylinks's avatar
rosskaff's avatar
aseem's avatar
mpjme's avatar
ojkelly's avatar
jorgecuadrafueyo's avatar
scisdahl's avatar
yinanfang's avatar
zhaojunbest's avatar
manatsawin's avatar
kbrabrand's avatar
mail's avatar
patrickarminio's avatar
vladkosinov's avatar
sean1's avatar
alejandroortiz's avatar
danillops's avatar
gavinmogan's avatar
mattwelke's avatar
webpack2's avatar
renatodex's avatar
hugufc's avatar
left_pad's avatar
maarten's avatar
marioestrada's avatar
me7's avatar
perrypoon's avatar
ganjianwei's avatar
joseluis_q's avatar
sebastiandedeyne's avatar
mattclarke's avatar
julianvmodesto's avatar
joanllenasmaso's avatar
jasonkelly6's avatar
ericstumper's avatar
coderliang's avatar
michalhantl's avatar
panutat's avatar
georgiowan's avatar
danez's avatar
saravieira's avatar
lukamaljic's avatar
andreykvital's avatar
me6's avatar
restuta's avatar
zangrafx's avatar
matiasfh's avatar
rene's avatar
heejongahn's avatar
rpkaper's avatar
hakimelek's avatar
dgrebb's avatar
osiegemund's avatar
givemedeals's avatar
lukepage's avatar
mirceadinoiu's avatar
maiis's avatar
vvoyer's avatar
sergiodxa's avatar
tamouse1's avatar
matthewerker's avatar
elexd3v's avatar
patrick's avatar
ivanzusko's avatar
jiyinyiyong's avatar
kkencom's avatar
mashaal's avatar
userdima's avatar
chkal's avatar
rchanou's avatar
rpgmorpheus's avatar
alexeyraspopov's avatar
stgeass's avatar
ivan1's avatar
andrewrota's avatar
restrry's avatar
andreychev's avatar
hey1's avatar
benimnetz's avatar
pedromsluz's avatar
avaly's avatar
vsevolodokhrin's avatar
xdamman's avatar
tadejafirman's avatar
peacengara's avatar
mindfulgeek's avatar
zhulongzheng's avatar
timrbula's avatar
poke5464's avatar
jbkimelman's avatar
eriktfox's avatar
antonalexandrenok's avatar
15jzhang's avatar
mattdionis's avatar
anriasaturov's avatar
dinakartumu's avatar
andreykravtsov's avatar
michaellebas's avatar
patrickneschkudla's avatar
nirgalon's avatar
proza's avatar
tatsuyanakano's avatar
christianmatsoukis's avatar
oliviercombe's avatar
mohammadumairk's avatar
maximprocopenco's avatar
thomasrandolph's avatar
ufoqhmdt's avatar
dmitrymatveevnz's avatar
lorenzosicilia's avatar
dealfy's avatar
jdinhlife's avatar
nalekberov's avatar
abarghoud's avatar
eliotik's avatar
frooeyzanny's avatar
gevmarlen's avatar
me21's avatar
timbergus's avatar
smiki-tky's avatar
kirill_shevch's avatar
kushalpandya's avatar
nathanwalker's avatar
niran's avatar
moritzsattler's avatar
danawoodman's avatar
tublitzed's avatar
josh's avatar
viliamelischer's avatar
bnayazil's avatar
sarah's avatar
kazupooot's avatar
lehoanganh25991's avatar
surajpoddar16's avatar
wangwusan's avatar
riyadhalnur's avatar
jm3's avatar
kiemhd's avatar
hstanleycrow's avatar
eduardo's avatar
junjiehuang's avatar
skillflow's avatar
cdelatorref's avatar