Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-app-rewired

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-app-rewired

Tweak the create-react-app webpack config(s) without using 'eject' and without creating a fork of the react-scripts

  • 2.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
361K
increased by5.87%
Maintainers
1
Weekly downloads
 
Created

What is react-app-rewired?

react-app-rewired is a package that allows you to customize the configuration of Create React App (CRA) without ejecting. It provides a way to override the default Webpack configuration, Babel configuration, and other settings in a non-intrusive manner.

What are react-app-rewired's main functionalities?

Override Webpack Configuration

This feature allows you to modify the Webpack configuration used by Create React App. In this example, a new rule is added to handle Markdown files using the 'raw-loader'.

module.exports = function override(config, env) {
  config.module.rules.push({
    test: /\.md$/,
    use: 'raw-loader'
  });
  return config;
};

Customize Babel Configuration

This feature allows you to customize the Babel configuration. In this example, the 'babel-plugin-styled-components' plugin is added to the Babel configuration.

module.exports = function override(config, env) {
  const babelLoader = config.module.rules.find(rule => rule.loader && rule.loader.includes('babel-loader'));
  babelLoader.options.plugins.push('babel-plugin-styled-components');
  return config;
};

Add Custom Scripts

This feature allows you to add custom scripts to your project. In this example, the 'babel-plugin-styled-components' plugin is added using the 'customize-cra' package.

const { override, addBabelPlugin } = require('customize-cra');
module.exports = override(
  addBabelPlugin('babel-plugin-styled-components')
);

Other packages similar to react-app-rewired

FAQs

Package last updated on 15 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc