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

customize-cra

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

customize-cra - npm Package Compare versions

Comparing version 0.1.0-beta4 to 0.1.0-beta5

23

index.js
const curry = require("lodash.curry");
const flow = require("lodash.flow");
const addBundleVisualizer = () => config => {
const addBundleVisualizer = (options = {}) => config => {
const BundleAnalyzerPlugin = require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: "static",
reportFilename: "report.html"
})
new BundleAnalyzerPlugin(
Object.assign(
{
analyzerMode: "static",
reportFilename: "report.html"
},
options
)
)
);

@@ -58,9 +63,3 @@ return config;

const override = (...pipeline) => (config, env) =>
flow(
...pipeline.map(f => {
const curried = curry(f, 2);
return curried(curry.placeholder, env);
})
)(config);
const override = (...plugins) => config => flow(...plugins.map(f => f || (a => a)))(config);

@@ -67,0 +66,0 @@ module.exports = {

{
"name": "customize-cra",
"version": "0.1.0-beta4",
"version": "0.1.0-beta5",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,8 @@ # customize-cra

---
To be clear, you need to use this project with `react-app-rewired`; be sure to read their docs if you never have. The code in this project, documented below, is designed to work inside of `react-app-rewired`'s `config-overrides.js` file.
---
To start, this project will export methods I need for what I'm using CRA for, but PRs will of course be welcome.

@@ -39,6 +45,15 @@

### addBundleVisualizer()
### addBundleVisualizer(options)
Adds the bundle visualizer plugin to your webpack config. Be sure to have `webpack-bundle-analyzer` installed.
Adds the bundle visualizer plugin to your webpack config. Be sure to have `webpack-bundle-analyzer` installed. By default, the options passed to the plugin will be
```js
{
analyzerMode: "static",
reportFilename: "report.html"
}
```
which can be overridden with the (optional) options argument.
## Using the plugins

@@ -45,0 +60,0 @@

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