Skip to content

cherkanovart/WebpackMustHave

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebpackMustHave

Webpack version: 5+

What is new in Webpack 5

  • Faster builds with persistent caching
  • Smaller bundle sizes (better tree-shaking)
  • Better long term caching

If you need Webpack4 take a look branch webpack_v4

How to run project

  1. Open project in VSCode (for example)
  2. Run command npm i in terminal (console) for installing all required packages (Node.js is required: https://nodejs.org/en/)
  3. For builing project you can use the following commands:
    • npm run build-prod - building production version (minimized and optimized). The project will be builded into build folder. You can change destination in webpack.common.js (line 19)
    • npm run build-dev - building development version
    • npm run serve - building development hot-reloaded version with webpack-dev-server

Recommended VSCode extensions

Features

  • Lint. Integrated the most popular linters: ESlint, Stylelint
  • BrowserList. All required browsers are pointed in .browserslistrc, so project will be compiled according to required browsers (babel, postcss, stylint use this file)
  • BrowserList. Stylelint. Integrated no-unsupported-browser-features, so during the css,scss-coding stylelint will show on-css rule that unsupported (according to .browserslistrc)
  • MockServer. For mocking api responses integrated webpack-mock-server that supports JS,TS and hot-replacement:
  • Styles. Integrated CSS-Modules and postcss-autoprefixer, postcss-normalize, OptimizeCSSAssetsPlugin (uses css-nano for production build)

TODO. Issues

  • add Prepack
  • fix peek-to-definition (for none-js-files): microsoft/TypeScript#15146
  • replace Prettier by better alternative (Prettier works bad)
  • add icomoon to fonts
  • Path autocomplete doesn't read path-alias-config from tsconfig.json

About

Must-have configuration for webpack

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 82.6%
  • TypeScript 8.2%
  • CSS 5.9%
  • HTML 3.1%
  • SCSS 0.2%