Build your
assets scripts

Static Resources .png .css .jpg .js Module dependency .jpg .png .sass .sass .js .sass .cjs .hbs .js

Write code

src/index.js

 import bar from  './ bar.js' ;

 bar ( ) ;

src/bar.js

 export  default  function  bar ( )  {
   //
 }

structure

Do not use configuration Or provide customized 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 >

Run on console webpack Commands, generating bundle.js

In depth learning

Quick Start Part of guide Chapter, if you are interested in in-depth study, you can refer to concept Chapter to understand the core concepts and underlying implementation of webpack.