赞助 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 (limited to the top 10).

Routee.net's avatarRetailMeNot, Inc.'s avatarMonoVM's avatarSitian Liu's avatarIntetics Inc's avatarTed Fitzpatrick's avatarAmy Pellegrini's avatarTuotemaailma's avatarPawel Grzybek's avatarVignesh Balasundaram'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 avatarAirbnb's avatarFacebook Open Source's avatarFrontend Masters's avatarCapital One's avatarAdobe's avatarCoinbase's avatarIndeed's avatar

银牌赞助

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

Webflow's avatarSlack's avatarAMP Project's avataregghead.io's avatarTipe's avatarThreadless Shop's avatarPeerigon's avatarZEIT's avatarN26's avatarPhotoEditorSDK's avatarRollbar's avatar上线了's avatarKeyCDN's avatarAlligator.io's avatarJared Palmer's avatarSentry.io's avatarSticker Mule's avatarGoogle Angular's avatarHubSpot's avatarAccelebrate's avatarFree Icons by Icons8's avatarWaffle.io's avatarPrincipal Financial Group's avatarAppfolio's avatarTrade Me's avatarKent C. Dodds's avatar5 minutes of React podcast's avatarKickstarter's avatarTeam Extension's avatarRoutee.net's avatarclay's avatar

铜牌赞助

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

Triplebyte's avatarBlockchain Training Alliance 's avatarAddy Osmani's avatarVTEX's avatarSebastian Software GmbH's avatarX-Team's avatarOmega Media's avatarAlgolia's avatarProductReview.com.au's avatarBCG Digital Ventures's avatarFire Stick Tricks's avatarEsben Petersen's avatarsynedra IT GmbH's avatarbinary option Thailand's avatarRaygun's avatarSarah Drasner's avatarJoshua Wiens's avatarYvo Schaap's avatarAndrew Lunny's avatarVolare Systems's avatarSoftwarePlant's avatarModus Create's avatarClevertech's avatarDan Abramov's avatarIrvin Waldman's avatarThe Training Advisors's avatarJetRuby Agency's avatarStatus Hero's avatarMarcus Hiles's avatarAviture Inc.'s avatarFred Carlsen's avatarreBuy's avatarCerner Engineering 's avatarChristian Alfoni's avatarEven Stensberg's avatarmantro GmbH's avatarTuro's avatarDontPayFull's avatarTrueVendor's avatarEducative.io's avataruudetkasinot.com's avatarYakaz's avatarRetailMeNot, Inc.'s avatarClaudio Rodriguez's avatarUudet Nettikasinot's avatarNya Casinon's avatarReact Native Training's avatarWonderProxy's avatarWork & Co's avatarArchitects.io's avatarBen Vinegar's avatarCory House's avatarDarko Kukovec's avatarJonathan Soifer's avatarAlex Liang's avatarRagunath Ramaswamy's avatarWonmin's avatarCodePilot.ai's avatarJonathon Landon's avatarRob Kielty's avatarAdam's avatarDerk-Jan Karrenbeld @SleeplessByte's avatarEliseu Monar dos Santos's avatarKarolis Astrauka's avatarTaopaiC Tao's avatarEmilio Martinez-Cordero's avatarChris Freeman's avatarShiva Nandan's avatarCodeFirst's avatarngAtl Conf's avatarVPS Server's avatarHosted.nl's avatarAandelen Kopen's avatarBettingFeber.se's avatarMonoVM's avatarMike Murry's avatarMixmax's avatarEvgeny Rodionov's avatarSuman Bharadwaj's avatarJayshri Sing's avatarByteScout's avatarI Done This'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. This list shows 100 randomly chosen backers:

Simon Kjellberg's avatar
Lochlan Bunn's avatar
Eric Lanehart's avatar
Tirell's avatar
Botika's avatar
Aaron Trostle's avatar
Oliver Zeigermann's avatar
PerfPerfPerf's avatar
Ross Kaffenberger's avatar
AB's avatar
Suhas Deshpande's avatar
Tyler McGinnis's avatar
bmqb's avatar
Kyle Warren's avatar
Ryan Helmoski's avatar
Brandon Pierce's avatar
Alexander Wunschik's avatar
Eduard Kyvenko's avatar
Mark Lozano's avatar
Freespin.nu's avatar
Craig Doremus's avatar
Jonathan Reem's avatar
Wellington Soares's avatar
Darren Scerri's avatar
Jean-Luc Geering's avatar
Jurica Železnjak's avatar
Norges Casino's avatar
Jason Barry's avatar
Kiyohito Kuwahara's avatar
Adam Cooper's avatar
Olivier Mourlevat's avatar
Adam Eury's avatar
Sunil Pai's avatar
Gavin Mogan's avatar
French Toasters LLC's avatar
paulhiers's avatar
Federico Bertani's avatar
Dean Pogni's avatar
Daniel Jenkins's avatar
Pedro Luz's avatar
Alex Chen's avatar
Dan J's avatar
Matt Welke's avatar
Priou's avatar
Andrey Knupp Vital's avatar
Kanitkorn Sujautra's avatar
Andy Brown's avatar
Jason Baciulis's avatar
Jamie Athanassakis's avatar
lex Alexander's avatar
Ivan Lagunovsky's avatar
Eduardo Rabelo's avatar
Martin Kammersberger's avatar
Dexter Haslem's avatar
Spencer Hamm's avatar
Klemen Slavic's avatar
Andi Semler's avatar
Ryan Johnson's avatar
Valuuttamuunnin's avatar
Dusan Radojevic's avatar
Lesha Koss's avatar
Nickolay Marchenko's avatar
Mobiparts's avatar
WhatsTheHost's avatar
Henry Zhu's avatar
Pat Khunachak's avatar
anonymous's avatar
Perry Poon's avatar
Fernando Daciuk's avatar
Intreba's avatar
Nikola Toshev's avatar
Currency Converter's avatar
안희종's avatar
Domain Promo's avatar
Web Hosting Professor's avatar
Yanagi Motonari's avatar
My True Media's avatar
Driven Coffee Roasters's avatar
Alexander Kaiser's avatar
AlarmDJ's avatar
WordPress kotisivut's avatar
Strømtest.no's avatar
anonymous's avatar
Tadeja Firman's avatar
Colton Colcleasure's avatar
Patrick Neschkudla's avatar
Craig Nguyen's avatar
Christian Matsoukis's avatar
Simon Stromberg's avatar
Patric Stromberg's avatar
Simon Stromberg's avatar
Antonio Yee's avatar
Anonymous's avatar
Simon Stromberg's avatar
Simon Stromberg's avatar
Simon Stromberg's avatar
Simon Stromberg's avatar
John Manoogian III's avatar
anonymous's avatar
Rachel Tublitz's avatar