Write Your Code

src/index.js import bar from './bar' ; bar ( ) ; src/bar.js export default function bar ( ) { }

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 > ... </ 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!

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