Skip to content

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Webpack Starter

Webpack JavaScript License GitHub Stars Repository views

A starter kit to quickly set up your JavaScript project with Webpack.
This is a configured Webpack build written in TypeScript for React + TypeScript development.

Table of Contents

Features

  • Production Ready: Minified and optimized builds.
  • Modern JavaScript: Write ESNext code with Babel.
  • CSS and SCSS Support: Import and bundle your styles.
  • Development Server: Live reloading with webpack-dev-server.
  • Code Splitting: Improve load times with dynamic imports.

Installation

To get started, clone the repository and install the dependencies:

git clone https://github.com/Creator11/webpack-starter.git
cd webpack-starter
yarn install

Scripts

Start the server to dev mode

  yarn start

Build development or production mode (defoult build run prod mode)

  yarn build:dev
  yarn build:prod

Run bundle analyze (defoult run production mode)

  yarn analyze

Run typeScript type check

  yarn typecheck

Run ESLint or scssLint to lint your code.

  yarn lint:ts
  yarn lint:scss

Lint fix

  yarn lint:ts:fix
  yarn lint:scss:fix

Additional Features/Information

  • All unused code is removed from the bundle (Tree shaking)
  • Progress plugin added to dev build (helps analyze bundle build speed)
  • All main filenames in the bundle are hashed for convenience
  • No page reload on code changes in dev server
  • Source maps are fully hashed in production bundle
  • Depending on the build type (production or development), the type of router is chosen:
    - in production createBrowserRouter
    - in development createHashRouter
  • Relative paths @/... are set (all paths are defined in webpack.config.ts in BuildPaths)
  • In dev mode, SCSS is not minified, allowing for better debugging
  • Source maps allow debugging in the original source code

Main plugins:
1.ForkTsCheckerWebpackPlugin 2.ReactRefreshWebpackPlugin 3.WebpackBar 4.MiniCssExtractPlugin 5.BundleAnalyzerPlugin

Contributing

Feel free to fork the repository and submit pull requests. Contributions are always welcome!

Thanks to all contributors of this package

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

webpack-starter config

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages