cra-webpack-rewired

1.0.1 • Public • Published

cra-webpack-rewired

A plugin to override create-react-app webpack configuration with minimal changes. This plugin internally uses the react-script only to start and build the application.

1. Installation

npm install --save-dev cra-webpack-rewired

2. Update the package.json, replace react-scripts command with cra-webpack-rewired command

 "scripts": {
-    "start": "react-scripts start",
+    "start": "cra-webpack-rewired start",
-    "build": "react-scripts build",
+    "build": "cra-webpack-rewired build",
  }

3. Add webpack extend file at path config/webpack.extend.js

module.exports = {
  dev: (config) => {
    //override webpack configuration
    config.externals =[..];
    return config;
  },
  prod: (config) => {
    //override webpack configuration
    config.externals =[..];
    return config;
  }
};

Thats it !

Package Sidebar

Install

npm i cra-webpack-rewired

Weekly Downloads

4

Version

1.0.1

License

ISC

Unpacked Size

4.5 kB

Total Files

7

Last publish

Collaborators

  • ashvin777