Write your code

app.js

import bar from './bar';

bar();

bar.js

export default function bar() {
  //
}

Bundle with 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>

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

It's that simple

Get Started

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!

Sponsors

Backers