赞助 webpack,同时从官方商店购买衣服 或者在这里购买贴纸!所有收益将转到我们的 open collective

bundle your
assets scripts

STATIC ASSETS .png .css .jpg .js MODULES WITH DEPENDENCIES .jpg .png .sass .sass .js .sass .cjs .hbs .js

编写代码

src/index.js

import bar from './bar';

bar();

src/bar.js

export default function bar() {
  //
}

使用 webpack 打包

Without config or provide custom webpack.config.js

const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
      path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js'
  }
};

page.html

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

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

让一切变得简单

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

支持团队

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

近期赞助

The following persons/organizations made their first donation in the last 14 days.

Jonathon Landon's avatarbmqb's avatarZoutons's avatarKelly Burke's avatarOwen Buckley's avatarKotisivut yritykselle's avatarSam Chen's avataranonymous's avatar

白金赞助

platinum sponsorsare those who have pledged $50,000 or more to webpack.

trivago's avatar

金牌赞助

gold sponsorsare those who have pledged $10,000 to $50,000 to webpack.

ag-Grid's avatarSegment's avatarAdobe's avatarCapital One's avatar

银牌赞助

silver sponsorsare those who have pledged $2,000 to $10,000 to webpack.

Facebook Open Source's avatarSlack's avatarAirbnb's avatarWebflow's avatarTipe's avatarCoinbase's avataregghead.io's avatarAMP Project's avatarPeerigon's avatar上线了's avatarKeyCDN's avatarSentry.io's avatarGoogle Angular's avatarFrontend Masters's avatarRollbar's avatarN26's avatar5 minutes of React podcast's avatar

铜牌赞助

bronze sponsorsare those who have pledged $200 to $2,000 to webpack.

PhotoEditorSDK's avatarKent C. Dodds's avatarWaffle.io's avatarJared Palmer's avatarAlligator.io's avatarAddy Osmani's avatarSticker Mule's avatarVTEX's avatarHubSpot's avatarAccelebrate's avatarX-Team's avatarIcons8's avatarAlgolia's avatarSebastian Software GmbH's avatarAppfolio's avatarProductReview.com.au's avatarEsben Petersen's avatarclay's avatarThreadless Shop's avatarsynedra IT GmbH's avatarSarah Drasner's avatarZEIT's avatarJoshua Wiens's avatarYvo Schaap's avatarAndrew Lunny's avatarSoftwarePlant's avatarClevertech's avatarModus Create's avatarThe Training Advisors's avatarBlockchain Training Alliance 's avatarTeam Extension's avatarJetRuby Agency's avatarCerner Engineering 's avatarreBuy's avatarAviture Inc.'s avatarDan Abramov's avatarChristian Alfoni's avatarIrvin Waldman's avatarDontPayFull's avatarFire Stick Tricks's avatarStatus Hero's avatarReact Native Training's avatarArchitects.io's avatarWork & Co's avatarBen Vinegar's avatarFred Carlsen's avatarWonmin's avatarMixmax's avatarEvgeny Rodionov's avatarI Done This's avatarJonathon Landon's avatar

赞助者

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.

Darko Kukovec's avatar
Cory House's avatar
Kevin James's avatar
Sasha Koss's avatar
Alex Liang's avatar
Ragunath Ramaswamy's avatar
Evan Scott's avatar
Matteo's avatar
Rob Kielty's avatar
Derk-Jan Karrenbeld @SleeplessByte's avatar
Nicolas Roos's avatar
Davin Hills's avatar
Eric Clemmons's avatar
Chris Lloyd's avatar
Adam's avatar
Eliseu Monar dos Santos's avatar
Karolis Astrauka's avatar
david8's avatar
Mike Murry's avatar
Lochlan Bunn's avatar
Botika's avatar
Steve Ricciardelli's avatar
Emilio Martinez-Cordero's avatar
ngAtl Conf's avatar
Chris Freeman's avatar
dev_to's avatar
Shiva Nandan's avatar
TaopaiC Tao's avatar
Shane Eckel's avatar
Johannes Weber's avatar
Claudio Rodriguez's avatar
Uptrend Technology, Inc.'s avatar
drdla's avatar
MoonMail's avatar
Suman Bharadwaj's avatar
Adam Recvlohe's avatar
Open Listings's avatar
MicroPyramid's avatar
Valentin Semirulnik's avatar
Yong Su's avatar
Knovour Zheng's avatar
谢彪's avatar
Jonathan Soifer's avatar
CodePilot.ai's avatar
Vladimir Starkov's avatar
Sean Clayton's avatar
Jon Seidel's avatar
Oliver Zeigermann's avatar
Albert Chang's avatar
AB's avatar
Jeremy Schlatter's avatar
Conor Hastings's avatar
Gil Barbara's avatar
Joel Chen's avatar
Rafał Filipek's avatar
Umut Sirin's avatar
Matt lewis's avatar
Simen Brekken's avatar
Jonathan Kim's avatar
Say Yup's avatar
Alex Leung's avatar
Travis Arnold's avatar
Michael Van Diest's avatar
Mark van den Brink's avatar
spalger's avatar
Simon Kjellberg's avatar
Jorge Antunes's avatar
Parker Bond's avatar
kuma's avatar
Neven Rodić's avatar
Ben Cao's avatar
Ajit Singh's avatar
Suhas Deshpande's avatar
Lagged's avatar
Alexander Shakun's avatar
Dzianis Sheka 's avatar
Leonard Souza's avatar
Arjun Sarode's avatar
александр староверов's avatar
Thorsten Lünborg's avatar
Eric Lanehart's avatar
Sean Larkin's avatar
Jacob Peddicord's avatar
Aaron Trostle's avatar
Robert Fruchtman's avatar
Adam Egesa's avatar
Tirell's avatar
Jonas Strømsodd's avatar
Eugene Baranov's avatar
Stephen R's avatar
Rey Bango's avatar
Tyler McGinnis's avatar
Yevgen Safronov's avatar
Carlos Guimaraes's avatar
Francisco Olmedo's avatar
Chris Villanueva's avatar
Nicolai Pascal Großer's avatar
Sijie Tian's avatar
Eduard Kyvenko's avatar
jules's avatar
Jeremy Morrell's avatar
Kevin Ball's avatar
Denny Schuldt's avatar
Vladimir Z's avatar
Martin Fischer's avatar
Mark Drake's avatar
Richard's avatar
Say Yup's avatar
Indexed's avatar
Michael Loughry's avatar
Alexander Wunschik's avatar
Zachary Origitano's avatar
Anatoliy Yastreb's avatar
Mark Thomas's avatar
Felipe Amorim's avatar
Oliver's avatar
Ross Kaffenberger's avatar
Michiel Westerbeek's avatar
Brandon Pierce's avatar
Jacob Mischka's avatar
Ching-Ting Wu's avatar
Wellington Soares's avatar
Samir Damle's avatar
Corjen's avatar
Alexander Mostovenko's avatar
Guillermo Sanchez's avatar
Sunil Pai's avatar
James Cham's avatar
Reinier Kaper's avatar
Dan Grebb's avatar
GiveMeDeals's avatar
jdinhify's avatar
Freegames66.com's avatar
Carey Hinoki's avatar
Adam Eury's avatar
Charlie Wettlaufer's avatar
anonymous's avatar
Rob Mellett's avatar
Andrew Vieyra's avatar
bmqb's avatar
Jason Laster's avatar
Grgur Grisogono's avatar
Josh Dzielak's avatar
Jurica Železnjak's avatar
Alejandro Brozzo's avatar
José Diaz Seng's avatar
Eugene Molokov's avatar
Kevin Clement's avatar
DomaiNesia's avatar
Rohit Kumar's avatar
paulhiers's avatar
Bruno Mota's avatar
Oliver's avatar
French Toasters LLC's avatar
Dealfy.co.uk's avatar
Benjamin Geese's avatar
Josh Lavely's avatar
JD's avatar
Jonathan Soifer's avatar
Mitchell Gates's avatar
Matters's avatar
mqklin's avatar
Two Bucks's avatar
Rolf Lekang's avatar
Eddy Hernandez's avatar
Marcus Nielsen's avatar
Dean Pogni's avatar
Arthur Stolyar's avatar
manuelbieh's avatar
Matija Marohnić's avatar
Matt Palmer's avatar
Selçuk Kiraz's avatar
Rude Ayelo's avatar
Jean-Luc Geering's avatar
Giovanni Orlando's avatar
David Jungst's avatar
Guilherme Rodrigues's avatar
Vu Tran's avatar
Greg Venech's avatar
Espen Hovlandsdal's avatar
Phil-lgr's avatar
Craig Doremus's avatar
Jonathan Reem's avatar
Aaron Godin's avatar
Daniel Treasure's avatar
Hozefa Jodiawalla's avatar
Mark Lozano's avatar
Kevin Pruett's avatar
Jarrod Davis's avatar
Dan J's avatar
webpackpro's avatar
Gaël Marziou's avatar
Ricky de Laveaga's avatar
Harun Hasdal's avatar
Darren Scerri's avatar
Artur Ptaszek's avatar
李勇's avatar
Mike Joyce's avatar
Johan Wendelstam's avatar
Mike Auclair's avatar
Davison Long's avatar
Alexander Wunschik's avatar
Chris Williams's avatar
Khiet Vo's avatar
Dylan Byth's avatar
Jeevan Palakurty's avatar
meyer's avatar
Peter Šulek's avatar
Kanitkorn Sujautra's avatar
Andy Brown's avatar
Tim Griesser's avatar
Cale Newman's avatar
Timber.io's avatar
Pavel Kornev's avatar
Jorge Cuadra's avatar
Steve McPherson's avatar
Kurtis Kemple's avatar
Andrey Popp's avatar
Yinan Fang's avatar
zhaojun's avatar
Maris Zemgalis's avatar
Jordi Teddy's avatar
Cucumber Limited's avatar
Gregory Nowakowski's avatar
Blake Cerecero's avatar
Paul Kotets's avatar
Craig Rubino's avatar
Web Desserts's avatar
Mukesh Soni's avatar
Jamie Athanassakis's avatar
Riderman De Sousa Barbosa's avatar
Spenser Isdahl's avatar
Andrey Koperskiy's avatar
Gavin Mogan's avatar
Endel Dreyer's avatar
Refael Dakar's avatar
Jake Day's avatar
Adam Howard's avatar
Sara Vieira's avatar
Andrey Knupp Vital's avatar
Alon David's avatar
Restuta's avatar
http://kaspertontti.fi's avatar
Eduardo Rabelo's avatar
Kenneth Brubaker's avatar
Ari Palo's avatar
Keith Ito's avatar
Martin Kammersberger's avatar
Joel Kemp's avatar
Richard Worsfold's avatar
Nathan Hunzaker's avatar
modulom's avatar
Ameya Koshti's avatar
Colin Wren's avatar
Ryan Graham's avatar
scottadamsmith's avatar
Kevin Scheffelmeier's avatar
Carlos Pérezpriego's avatar
Brainly's avatar
Eirik Birkeland's avatar
Snaptortoise's avatar
Ken Colton's avatar
Ron McCranie's avatar
Ryan Helmoski's avatar
Patrick Szczypinski's avatar
Andrei Zvonimir Crnković's avatar
Kevin Maes's avatar
Jan-Kanty Pawelski's avatar
Ben Vinegar's avatar
Dmitry Kabak's avatar
Jiyin Yiyong's avatar
Alexey Raspopov's avatar
александр темный's avatar
Ivan Lagunovsky's avatar
Andrew Rota's avatar
Philipp Andreychev's avatar
Bulan's avatar
Pedro Luz's avatar
Valentin Agachi's avatar
Andreas Keller's avatar
Kostas Manionis's avatar
Christian Kaltepoth's avatar
omar mashaal's avatar
Viktor Hubert's avatar
Davidson Fellipe's avatar
Samir Alajmovic's avatar
Timothy Bula's avatar
Ginhing Lee's avatar
Jeremia Kimelman's avatar
Anton Alexandrenok's avatar
Jack Zhang's avatar
Matt Dionis's avatar
Alexander Pustomelnyk's avatar
Sergey Sharov's avatar
Santeri Hiltunen's avatar
Karan Nijhawan's avatar
Matt Welke's avatar
Leonidas Esteban's avatar
Luka Maljic's avatar
Daniel Jenkins's avatar
Sam Julien's avatar
Josema EnZo's avatar
Klemen Slavic's avatar
13web's avatar
Zack Ward's avatar
Ryan Johnson's avatar
Ben McCormick's avatar
Ready Chi's avatar
Dexter Haslem's avatar
Sylvain's avatar
Anders Hansen's avatar
Rocco Curcio's avatar
Restrry Mike's avatar
Tom Liu's avatar
Anup's avatar
Vladimir Kalinichev's avatar
Erik Fox's avatar
Artur Kulig's avatar
Pedro Piñera Buendía's avatar
Evgeny Samsonov's avatar
Giorgio Natili's avatar
Gustavo Muñoz's avatar
Maxflow BVBA (BE 0550.758.377)'s avatar
Emanuele Rampichini's avatar
Phil Plückthun's avatar
Matt Hargett's avatar
David Ang's avatar
Dylan Kirkby's avatar
Knoji's avatar
Bhargav Ponnapalli's avatar
Oliver Wehn's avatar
Viesturs Teivāns's avatar
Mark Fayngersh's avatar
Andi Semler's avatar
Robert Borg's avatar
Alex Chen's avatar
Drathal's avatar
Cassio Cardoso's avatar
Zoutons's avatar
G P's avatar
Moritz Mahringer's avatar
Woojin Joe's avatar
George Yong's avatar
Ronald ChanOu's avatar
Priou's avatar
Fravic's avatar
Jason Baciulis's avatar
Tamouse Temple's avatar
Evgeny Timoshenko's avatar
Mustafa Rashid's avatar
Nabarun Bhowmick's avatar
Arti Villa's avatar
Yazan Aabed's avatar
Luke Bennett's avatar
Eric Feng's avatar
Daiquiri.io's avatar
PromoCodeWatch's avatar
Navid Shekoufa's avatar
Rich Seviora's avatar
Dealspotr's avatar
Kevin Ortman's avatar
Cody Mercer's avatar
Hugo Freitas's avatar
Dano Alexander's avatar
Ziad Jammal's avatar
Dusan Radojevic's avatar
Gene Chulkov's avatar
Spencer Hamm's avatar
Prince Bechani's avatar
Dan DiGangi's avatar
Aseem Sood's avatar
Mattias Johansson's avatar
Owen Kelly's avatar
Longzheng Zhu's avatar
WenmingTang's avatar
Hongmin Qiao's avatar
Manatsawin Hanmongkolchai's avatar
Elberth Jaimes's avatar
Sebastian De Deyne's avatar
Dani Llops's avatar
Renato Alves's avatar
Luís Fontes's avatar
加藤賢太's avatar
Alexander Kozhevin's avatar
Freegames66's avatar
Sean Matheson's avatar
Craig Kochis's avatar
Robert Požarickij's avatar
Mobiparts's avatar
Vlad Kosinov's avatar
Patrick Arminio's avatar
Kristoffer Brabrand's avatar
Alejandro Ortiz's avatar
Ferdinand Salis-Samaden's avatar
Henry Zhu's avatar
Jian Wei Gan's avatar
Jose Quintana's avatar
Matt Clarke's avatar
Julian Modesto's avatar
Joan Llenas's avatar
Jason Kelly's avatar
Eric Stumper's avatar
Snow Liang's avatar
Michal Hantl's avatar
Pat Khunachak's avatar
Georgio Wan's avatar
Daniel Tschinder's avatar
Krzysztof Matysiak's avatar
Wen Tian Zhang's avatar
Matias Arellano's avatar
Rene Herrmann's avatar
안희종's avatar
Maarten Tibau's avatar
kz's avatar
binkpitch's avatar
Petagadget's avatar
alinnert's avatar
Elegant Media's avatar
多会's avatar
Charles Pinnix's avatar
Biohackers Lab's avatar
Intreba's avatar
Noah Lemen's avatar
Andor Polgar's avatar
Steve's avatar
Lucas Farías's avatar
JobNinja GmbH's avatar
Domain Promo's avatar
Jason Tokoph's avatar
Currency Converter's avatar
Kevin Killingsworth's avatar
Mike Elsmore's avatar
Instant's avatar
Digifly Marketing's avatar
Z Roofing & Waterproofing's avatar
Let's Remodel's avatar
Albany Tree & Property Service's avatar
Kelly Burke's avatar
lei's avatar
Mario Estrada's avatar
Perry Poon's avatar
Malek Hakim's avatar
Harold Crow's avatar
Bobbink - Ferienparkspecials's avatar
Yanagi Motonari's avatar
Sergio Xalambrí's avatar
Matthew Erker's avatar
Alexander Kaiser's avatar
Patrick Collison's avatar
Ivan Zusko's avatar
Jaap Lorier's avatar
Chris Nienhuis's avatar
Graham Holborn's avatar
Daniel O'Connor's avatar
anonymous's avatar
Niel de la Rouviere's avatar
Anton Moiseev's avatar
henri js framework's avatar
Connor Clark's avatar
Robert Knight's avatar
kkpoon's avatar
Mircea Dinoiu's avatar
Vincent Voyer's avatar
Luke Page's avatar
Emmanuel Vuigner's avatar
Constructor Labs's avatar
Joe Palladino's avatar
Nokey King's avatar
Alex Parish's avatar
Hank Andre's avatar
Theo Salzmann's avatar
Philip John Basile's avatar
Led Grow Lights's avatar
IO Space's avatar
Kotisivut yritykselle's avatar
Even Stensberg's avatar
Dale Price's avatar
Therefore Interactive's avatar
Restpack's avatar
Peace Ngara's avatar
Vsevolod Okhrin's avatar
Xavier Damman's avatar
Tadeja Firman's avatar
Daniel Arthur Gallagher's avatar
Patrick Neschkudla's avatar
Nir Galon's avatar
Craig Nguyen's avatar
Patrick Roza's avatar
Tatsuya Nakano's avatar
Christian Matsoukis's avatar
Olivier Combe's avatar
Mohammad Umair Khan's avatar
Maxim Procopenco's avatar
Dani Klein's avatar
Thomas Randolph's avatar
Dmitry Matveev's avatar
Lorenzo Sicilia's avatar
aga5tya's avatar
admin6's avatar
Mohamad Al Asmar's avatar
Peak Digital K.K.'s avatar
Colton Colcleasure's avatar
Bharath's avatar
Owen Buckley's avatar
Anri Asaturov's avatar
Dinakar Tumu's avatar
Andrey Kravtsov's avatar
Michael Lebas's avatar
Marlen Gevorkyan's avatar
Kevin Scott's avatar
Suraj Poddar's avatar
Zaeburn Mercer's avatar
Animalsluxury's avatar
Kontaktlinsen-Preisvergleich GmbH's avatar
GuruGate's avatar
HostPresto's avatar
Nurlan Alekberov's avatar
Antonio Yee's avatar
Anas Barghoud's avatar
Gustaf Brostedt's avatar
Soichiro Miki's avatar
Kirill Shevchenko's avatar
Elías Rafael  Rodelo Osorio's avatar
Dana Woodman's avatar
Rachel Tublitz's avatar
Josh Manders's avatar
Viliam Elischer's avatar
Bnaya Zilberfarb's avatar
Sarah Lim's avatar
Kazuhito Higashioka's avatar
John Manoogian III's avatar
Anh Hoang's avatar
Kushal Pandya's avatar
Ryan Tallmadge's avatar
Brainly's avatar
Asjad Saboor's avatar
Cody Chan's avatar
Eadepardazan's avatar
Niran Babalola's avatar
Jaeseung Yum's avatar
Dirk Preising's avatar
oguzhan susam's avatar
Kotisivut yritykselle's avatar
Sam Chen's avatar
anonymous's avatar
Nathan Walker's avatar
Moritz Sattler's avatar
Alexander Grigoriev's avatar
wusan's avatar
2x3's avatar
Kiem Hoang's avatar
Riyadh Al Nur's avatar
Junjie Huang's avatar
SkillFlow's avatar
Carlos De La Torre Fregoso's avatar
Sk's avatar