@jdcrensh/react-scripts
v5.0.2-0
Published
Configuration and scripts for Create React App.
Downloads
16
Readme
react-scripts
This package includes scripts and configuration used by Create React App. Please refer to its documentation:
- Getting Started – How to create a new app.
- User Guide – How to develop apps bootstrapped with Create React App.
Configuration & Plugin Support (unofficial)
This is an unofficial fork that extends Create React App with an interface for plugins and custom config.
If a cra.config.js
plugin doesn't exist, there's no difference than if you were using the official package.
Configuration
An ES5 module exported by cra.config.js
at the app's root is used for configuration. Each property is optional.
| Property | Type | Description |
| --------- | --------------------- | ------------------------------------------ |
| [plugins] | array | plugin references or names. default: []
|
| [apply] | function | webpack config. default: identity function |
| [babel] | function | babel config. default: identity function |
Example
module.exports = {
// Load plugins by name and/or by reference. Loading plugins by name is for
// convenience, eg. `'css-modules'` is the same as `require('react-scripts-plugin-css-modules')`
plugins: ['no-minify', require('./my-internal-plugin')],
// Webpack configuration
apply: (config, { env, paths }) => {
return config;
},
// Babel configuration
babel: (config, { env, paths }) => {
return config;
},
};
Plugins
A plugin is simply an exported custom config without the plugins
property.