3.2.0 • Published 2 months ago

react-scripts-custom-config v3.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 months ago

react-scripts-custom-config

A forked version of CRA's react-scripts which support customisation of config with out ejecting.

This package includes scripts and configuration used by Create React App. Please refer to its documentation:


Quick Start

npx create-react-app <project-name> --scripts-version react-scripts-custom-config

Customising config

In your project's root create a folder archetype. Create a config file with same name say if you want to customise Webpack config, then create a file webpack.config.js under <root-dir>/archetype. Add your customised config.

module.exports = (webpackEnv, defaultConfig) => {
    // defaultConfig - config provided by CRA, you can mutate/override it as per you needs and pass the same

    const webpackConfig = {
      ...
    };

    return webpackConfig
}

Similarly to you can customise Webpack DEV Sever config by creating a file webpackDevServer.config.js & Jest config with jest.config.js as shown above.