webpack vs vite vs react-scripts vs react-app-rewired vs customize-cra vs craco
React Configuration Tools and Build Systems Comparison
1 Year
webpackvitereact-scriptsreact-app-rewiredcustomize-cracracoSimilar Packages:
What's React Configuration Tools and Build Systems?

These packages are primarily used for configuring and building React applications. They provide various levels of customization and control over the build process, allowing developers to tailor their development environment to meet specific needs. Understanding the differences between these tools is crucial for optimizing performance, improving development speed, and ensuring maintainability in React projects.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
webpack28,734,48665,0645.21 MB23113 days agoMIT
vite21,834,67770,9402.85 MB580a day agoMIT
react-scripts2,947,574103,117116 kB2,2963 years agoMIT
react-app-rewired358,8609,85648.9 kB18-MIT
customize-cra194,1152,791-1155 years agoMIT
craco10,615890.9 kB0-MIT
Feature Comparison: webpack vs vite vs react-scripts vs react-app-rewired vs customize-cra vs craco

Customization

  • webpack:

    Webpack is a highly configurable module bundler that allows for extensive customization of the build process. It supports a wide range of plugins and loaders, enabling developers to tailor their setup to meet specific project requirements, making it ideal for complex applications.

  • vite:

    Vite is designed for modern web development, offering a fast and flexible build system. It allows for extensive customization through plugins and configuration files, making it suitable for developers who want to leverage modern JavaScript features and optimize their build process.

  • react-scripts:

    React Scripts is the default configuration for Create React App, providing a zero-configuration setup. It abstracts away the complexity of Webpack and Babel, allowing developers to focus on writing code without worrying about build configurations.

  • react-app-rewired:

    React App Rewired allows you to customize the CRA configuration without ejecting. It uses a single configuration file to override the default settings, making it straightforward to add custom features while maintaining a clean project structure.

  • customize-cra:

    Customize CRA offers a functional approach to customizing Create React App. It provides a set of functions to modify the Webpack configuration directly, allowing for targeted changes while keeping the original CRA setup intact. This is ideal for developers who prefer a more programmatic way to apply customizations.

  • craco:

    CRACO allows for easy customization of Create React App without ejecting. It provides a simple configuration file where you can modify Webpack settings, Babel configurations, and more, making it user-friendly for developers who want to tweak their setup without losing the benefits of CRA.

Performance

  • webpack:

    Webpack can be optimized for performance through various configurations, such as tree shaking, code splitting, and caching strategies. However, achieving optimal performance requires a deeper understanding of its configuration options.

  • vite:

    Vite is known for its exceptional performance, especially during development. It uses native ES modules and a fast hot module replacement (HMR) system, resulting in rapid feedback for developers and optimized builds for production.

  • react-scripts:

    React Scripts provides a well-optimized build process out of the box, ensuring good performance for most applications. However, it may not offer the same level of performance tuning as more customizable tools like Webpack or Vite.

  • react-app-rewired:

    React App Rewired maintains the performance benefits of CRA while allowing for custom optimizations. Developers can tweak the Webpack settings to improve build speed and runtime performance without ejecting.

  • customize-cra:

    Customize CRA can enhance performance by allowing developers to fine-tune the Webpack configuration, such as enabling code splitting and optimizing asset loading, leading to faster application load times.

  • craco:

    CRACO does not inherently improve performance but allows you to optimize your CRA setup by modifying the underlying Webpack configuration. This can lead to better build times and improved application performance if configured correctly.

Learning Curve

  • webpack:

    Webpack has a steep learning curve due to its complexity and extensive configuration options. New users may find it challenging to grasp its concepts, but it offers powerful features for those willing to invest the time to learn.

  • vite:

    Vite has a low learning curve for developers familiar with modern JavaScript frameworks. Its straightforward configuration and focus on developer experience make it easy to adopt, especially for those transitioning from CRA or Webpack.

  • react-scripts:

    React Scripts is the easiest to use for beginners, as it requires no configuration. Developers can start building applications immediately without needing to understand the underlying build tools.

  • react-app-rewired:

    React App Rewired is relatively easy to learn for developers familiar with Create React App. Its single configuration file simplifies the process of overriding settings, making it accessible for most users.

  • customize-cra:

    Customize CRA has a moderate learning curve, as it requires understanding how to use functional programming concepts to modify the Webpack configuration. Developers need to be comfortable with JavaScript to effectively use this tool.

  • craco:

    CRACO has a gentle learning curve, especially for those familiar with Create React App. Its configuration file is straightforward, making it easy for developers to implement customizations without extensive knowledge of Webpack.

Ecosystem and Community Support

  • webpack:

    Webpack has a mature ecosystem with extensive community support. It is widely used in the industry, and there are countless resources, plugins, and tools available to help developers optimize their configurations.

  • vite:

    Vite has rapidly gained popularity and has a vibrant community. Its modern approach and performance benefits have attracted many developers, resulting in a wealth of plugins and resources.

  • react-scripts:

    React Scripts is widely used and has a large community, providing extensive documentation and resources. It is the default choice for CRA, ensuring robust support and frequent updates.

  • react-app-rewired:

    React App Rewired enjoys strong community support due to its popularity among CRA users. Many tutorials and resources are available to help developers implement custom configurations effectively.

  • customize-cra:

    Customize CRA has a dedicated user base and is actively maintained. Its integration with CRA ensures that developers can find help and resources related to common customization scenarios.

  • craco:

    CRACO has a growing community and is well-supported within the Create React App ecosystem. It benefits from the popularity of CRA, making it easier to find resources and community support.

Build Speed

  • webpack:

    Webpack's build speed can vary significantly based on configuration. While it can be optimized for performance, achieving fast build times often requires careful tuning and understanding of its features.

  • vite:

    Vite is designed for speed, offering extremely fast builds and hot module replacement. Its architecture allows for rapid development cycles, making it an excellent choice for projects that require quick iteration.

  • react-scripts:

    React Scripts provides a well-optimized build process, ensuring good build speeds for most applications. However, it may not match the speed of more modern tools like Vite.

  • react-app-rewired:

    React App Rewired maintains the build speed of CRA while allowing for custom optimizations. Developers can tweak settings to enhance build performance without ejecting.

  • customize-cra:

    Customize CRA can improve build speed by enabling specific optimizations within the Webpack configuration, allowing for faster builds and better performance during development.

  • craco:

    CRACO does not directly impact build speed, but it allows developers to optimize their CRA configurations, which can lead to faster builds if configured properly.

How to Choose: webpack vs vite vs react-scripts vs react-app-rewired vs customize-cra vs craco
  • webpack:

    Select Webpack if you need a highly configurable and powerful build tool for complex applications. It is best suited for projects that require custom configurations and optimizations, offering extensive features for code splitting, asset management, and plugin support.

  • vite:

    Choose Vite if you prioritize speed and modern development features. Vite offers an extremely fast development server and builds process, making it suitable for projects that require rapid iteration and modern tooling, especially with frameworks like React.

  • react-scripts:

    Opt for React Scripts if you are starting a new Create React App project and want a zero-configuration setup. It provides a robust build system and development environment out of the box, making it ideal for beginners or projects that do not require extensive customization.

  • react-app-rewired:

    Use React App Rewired if you need to customize Create React App without ejecting and want to maintain a straightforward configuration. It allows you to override the default Webpack config and is beneficial for developers who want to keep their setup simple while adding custom features.

  • customize-cra:

    Select Customize CRA if you are looking for a way to modify the Create React App configuration using a more functional approach. It is suitable for developers who want to apply specific customizations without ejecting and prefer a plugin-based system for managing changes.

  • craco:

    Choose CRACO if you want to customize Create React App without ejecting. It allows you to override the default configuration easily and is ideal for developers who want a simple way to add custom configurations while maintaining the benefits of Create React App.

README for webpack


npm

node builds1 builds2 dependency-review coverage PR's welcome compatibility-score downloads install-size backers sponsors contributors discussions discord

webpack

Webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

Table of Contents

Install

Install with npm:

npm install --save-dev webpack

Install with yarn:

yarn add webpack --dev

Introduction

Webpack is a bundler for modules. The main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable of transforming, bundling, or packaging just about any resource or asset.

TL;DR

  • Bundles ES Modules, CommonJS, and AMD modules (even combined).
  • Can create a single bundle or multiple chunks that are asynchronously loaded at runtime (to reduce initial loading time).
  • Dependencies are resolved during compilation, reducing the runtime size.
  • Loaders can preprocess files while compiling, e.g. TypeScript to JavaScript, Handlebars strings to compiled functions, images to Base64, etc.
  • Highly modular plugin system to do whatever else your application requires.

Learn about webpack through videos!

Get Started

Check out webpack's quick Get Started guide and the other guides.

Browser Compatibility

Webpack supports all browsers that are ES5-compliant (IE8 and below are not supported). Webpack also needs Promise for import() and require.ensure(). If you want to support older browsers, you will need to load a polyfill before using these expressions.

Concepts

Plugins

Webpack has a rich plugin interface. Most of the features within webpack itself use this plugin interface. This makes webpack very flexible.

| Name | Status | Install Size | Description | | :---------------------------------------: | :----------------: | :-----------------: | :-------------------------------------------------------------------------------------- | | mini-css-extract-plugin | mini-css-npm | mini-css-size | Extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. | | compression-webpack-plugin | compression-npm | compression-size | Prepares compressed versions of assets to serve them with Content-Encoding | | html-webpack-plugin | html-plugin-npm | html-plugin-size | Simplifies creation of HTML files (index.html) to serve your bundles | | pug-plugin | pug-plugin-npm | pug-plugin-size | Renders Pug files to HTML, extracts JS and CSS from sources specified directly in Pug. |

Loaders

Webpack enables the use of loaders to preprocess files. This allows you to bundle any static resource way beyond JavaScript. You can easily write your own loaders using Node.js.

Loaders are activated by using loadername! prefixes in require() statements, or are automatically applied via regex from your webpack configuration.

Files

| Name | Status | Install Size | Description | | :---------------: | :--------: | :----------: | :------------------------------------------------------- | | val-loader | val-npm | val-size | Executes code as module and considers exports as JS code |

JSON

| Name | Status | Install Size | Description | | :---------------------------------------------------------------------------------------------------------------------------------------: | :---------: | :----------: | :------------------------------: | | | cson-npm | cson-size | Loads and transpiles a CSON file |

Transpiling

| Name | Status | Install Size | Description | | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------: | :------------: | :------------------------------------------------------------------------------------------------ | | | babel-npm | babel-size | Loads ES2015+ code and transpiles to ES5 using Babel | | | type-npm | type-size | Loads TypeScript like JavaScript | | | coffee-npm | coffee-size | Loads CoffeeScript like JavaScript |

Templating

| Name | Status | Install Size | Description | | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------: | :--------------: | :-------------------------------------------------------------------------------------- | | | html-npm | html-size | Exports HTML as string, requires references to static resources | | | pug-npm | pug-size | Loads Pug templates and returns a function | | | pug3-npm | pug3-size | Compiles Pug to a function or HTML string, useful for use with Vue, React, Angular | | | md-npm | md-size | Compiles Markdown to HTML | | | posthtml-npm | posthtml-size | Loads and transforms a HTML file using PostHTML | | | hbs-npm | hbs-size | Compiles Handlebars to HTML |

Styling

| Name | Status | Install Size | Description | | :-------------------------------------------------------------------------------------------------------------------------------------------: | :------------: | :-------------: | :----------------------------------------------------------------------- | | <style> | style-npm | style-size | Add exports of a module as style to DOM | | | css-npm | css-size | Loads CSS file with resolved imports and returns CSS code | | | less-npm | less-size | Loads and compiles a LESS file | | | sass-npm | sass-size | Loads and compiles a Sass/SCSS file | | | stylus-npm | stylus-size | Loads and compiles a Stylus file | | | postcss-npm | postcss-size | Loads and transforms a CSS/SSS file using PostCSS |

Frameworks

| Name | Status | Install Size | Description | | :----------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------: | :-------------: | :----------------------------------------------------------------------------------------------------- | | | vue-npm | vue-size | Loads and compiles Vue Components | | | polymer-npm | polymer-size | Process HTML & CSS with preprocessor of choice and require() Web Components like first-class modules | | | angular-npm | angular-size | Loads and compiles Angular 2 Components | | | riot-npm | riot-size | Riot official webpack loader | | | svelte-npm | svelte-size | Official Svelte loader |

Performance

Webpack uses async I/O and has multiple caching levels. This makes webpack fast and incredibly fast on incremental compilations.

Module Formats

Webpack supports ES2015+, CommonJS and AMD modules out of the box. It performs clever static analysis on the AST of your code. It even has an evaluation engine to evaluate simple expressions. This allows you to support most existing libraries out of the box.

Code Splitting

Webpack allows you to split your codebase into multiple chunks. Chunks are loaded asynchronously at runtime. This reduces the initial loading time.

Optimizations

Webpack can do many optimizations to reduce the output size of your JavaScript by deduplicating frequently used modules, minifying, and giving you full control of what is loaded initially and what is loaded at runtime through code splitting. It can also make your code chunks cache friendly by using hashes.

Contributing

We want contributing to webpack to be fun, enjoyable, and educational for anyone, and everyone. We have a vibrant ecosystem that spans beyond this single repo. We welcome you to check out any of the repositories in our organization or webpack-contrib organization which houses all of our loaders and plugins.

Contributions go far beyond pull requests and commits. Although we love giving you the opportunity to put your stamp on webpack, we also are thrilled to receive a variety of other contributions including:

To get started have a look at our documentation on contributing.

Creating your own plugins and loaders

If you create a loader or plugin, we would <3 for you to open source it, and put it on npm. We follow the x-loader, x-webpack-plugin naming convention.

Support

We consider webpack to be a low-level tool used not only individually but also layered beneath other awesome tools. Because of its flexibility, webpack isn't always the easiest entry-level solution, however we do believe it is the most powerful. That said, we're always looking for ways to improve and simplify the tool without compromising functionality. If you have any ideas on ways to accomplish this, we're all ears!

If you're just getting started, take a look at our new docs and concepts page. This has a high level overview that is great for beginners!!

If you have discovered a 🐜 or have a feature suggestion, feel free to create an issue on GitHub.

Current project members

For information about the governance of the Node.js project, see GOVERNANCE.md.

TSC (Technical Steering Committee)

Core Collaborators

Sponsoring

Most of the core team members, webpack contributors and contributors in the ecosystem do this open source work in their free time. If you use webpack for a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.

This is how we use the donations:

  • Allow the core team to work on webpack
  • Thank contributors if they invested a large amount of time in contributing
  • Support projects in the ecosystem that are of great value for users
  • Support projects that are voted most (work in progress)
  • Infrastructure cost
  • Fees for money handling

Premium Partners

Other Backers and Sponsors

Before we started using OpenCollective, donations were made anonymously. Now that we have made the switch, we would like to acknowledge these sponsors (and the ones who continue to donate using OpenCollective). If we've missed someone, please send us a PR, and we'll add you to this list.

Gold Sponsors

Become a gold sponsor and get your logo on our README on GitHub with a link to your site.

Silver Sponsors

Become a silver sponsor and get your logo on our README on GitHub with a link to your site.

Bronze Sponsors

Become a bronze sponsor and get your logo on our README on GitHub with a link to your site.

Backers

Become a backer and get your image on our README on GitHub with a link to your site.

Special Thanks to

(In chronological order)

  • @google for Google Web Toolkit (GWT), which aims to compile Java to JavaScript. It features a similar Code Splitting as webpack.
  • @medikoo for modules-webmake, which is a similar project. webpack was born because of the desire for code splitting for modules such as Webmake. Interestingly, the Code Splitting issue is still open (thanks also to @Phoscur for the discussion).
  • @substack for browserify, which is a similar project and source for many ideas.
  • @jrburke for require.js, which is a similar project and source for many ideas.
  • @defunctzombie for the browser-field spec, which makes modules available for node.js, browserify and webpack.
  • @sokra for creating webpack.
  • Every early webpack user, which contributed to webpack by writing issues or PRs. You influenced the direction.
  • All past and current webpack maintainers and collaborators.
  • Everyone who has written a loader for webpack. You are the ecosystem...
  • Everyone not mentioned here but that has also influenced webpack.