cra-webpack-rewired
Version:
A plugin to override create-react-app webpack configuration with minimal changes
13 lines (10 loc) • 408 B
JavaScript
const rewire = require('rewire');
module.exports = function execute(override) {
const defaults = rewire('react-scripts/scripts/build.js');
//In order to override the webpack configuration without ejecting the create-react-app
const config = defaults.__get__('config');
//Override webpack configuration
if (override && override.prod) {
defaults.__set__('config', override.prod(config));
}
}