Skip to content

martin-corevski/webpack-basics

Repository files navigation


Webpack 4 basics

Webpack 4 basic setup with watch, dev server, css/scss, html, file loaders and plugins included.


Packages installed

  • In-depth explanation in the wiki

Install dependencies

cd path-to-your-project
npm install

Additional install

npm i -g ntl
  • By running ntl you can choose which script to run. For example start, build, build:prod and watch will be some of the choices. All of these scripts are in the package.json file in the scripts object.
  • Command to start ntl and choose an option
ntl

Without ntl

If you don't want to use ntl you can use the npm run command with the chosen script, examples:

  • For development bundle
npm run build
  • For production ready bundle
npm run build:prod
  • For development server
npm start
  • For Webpack watch
npm run watch

Resources used

Official docs

Youtube

Medium


License

MIT