🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@horacehylee/react-scripts-webpack-config-editor

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@horacehylee/react-scripts-webpack-config-editor

edit the react-scripts webpack config for dev and prod builds!

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

react-scripts-webpack-config-editor

edit the react-scripts webpack config at runtime.

Codeship Status for cdaringe/react-scripts-webpack-config-editor JavaScript Style Guide

install

npm install --save-dev react-scripts-webpack-config-editor

usage

  • update your package.json and add an install script
// package.json
{
  "scripts": {
    "install": "react-scripts-webpack-config-editor <my-webpack-transformer.js>"
  }
}
  • add your transformer
// my-webpack-transformer.js
module.exports = function editWebpackConfig (webpackConfig) {
  // webpackConfig is the parsed JS webpack config from react-scrips.
  // modify it here synchronously, & return it.
  return Object.assign({}, webpackConfig, {
    ...my-webpack-customizations
  })
}

why

you love create-react-app, but need just a tiny tweak to the build process.

why not

the whole point of sticking with react-scripts is offloading the complexity of the build system (webpack), and getting rolling updates. tweaking it implies that you want ownership of the build process!

justification

if you must change the build used by react-scripts (create-react-app) you can either fork the project, or react-scripts eject. until now!

  • forking stinks. rolling updates come with a cost of you or your team pulling down the upstream project. further, git conflicts are bound to follow.
  • ejecting stinks. you get a ton of code pushed into your codebase & immediately onboard technical debt by absorbing all of that code.

your custom modifications are sure to break when you bump react-scripts. however, the amount of modifications should be limited, so hopefully you only need to patch a few lines in your transformer.

FAQs

Package last updated on 22 Sep 2019

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