Webpack is a module bundler. Webpack takes modules with dependencies and generates static assets representing those modules.
The main interest of using Webpack is that it will compile all your styles - which we advise you to write using Sass - into a single CSS file. This way, your theme will make only one HTTP request for this single file, and since your browser will cache it for later re-use, it will even download this file only once.
If you want to compile your assets using Webpack (and we advise you to), follow these steps:
npm run build.
npm run watch.
The Webpack configuration file for Classic Theme is thus:
It provides proper configuration for compile your Sass, Less, Stylus or CSS files into a single CSS file.
If you want to use Stylus or Less, simply edit the command line under the “scripts” section.