bundle your
assets scripts

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

Write Your Code

Image for: Write Your Code

src/index.js

import bar from './bar.js';

bar();

src/bar.js

export default function bar() {
  //
}

Bundle It

Image for: Bundle It

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>
    <meta charset="utf-8" />
    ...
  </head>
  <body>
    ...
    <script src="dist/bundle.js"></script>
  </body>
</html>

Then run webpack on the command-line to create bundle.js.

Awesome, isn't it? Let's dive in!

Image for: Awesome, isn't it? Let's dive in!

Get Started quickly in our Guides section, or dig into the Concepts section for more high-level information on the core notions behind webpack.

Support the Team

Through contributions, donations, and sponsorship, you allow webpack to thrive. Your donations directly support office hours, continued enhancements, and most importantly, great documentation and learning material!

Latest Sponsors

Image for: Latest Sponsors

 

 

 

Platinum Sponsors

Image for: Platinum Sponsors

 

 

 

Gold Sponsors

Image for: Gold Sponsors

 

 

 

Silver Sponsors

Image for: Silver Sponsors

 

 

 

Bronze Sponsors

Image for: Bronze Sponsors

 

 

 

Backers

Image for: Backers