GeekyAnts / GeekyAnts/NativeBase-KitchenSink
Merging the recommended config-overrides with an existing file
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I have an existing `config-overrides.js` file that was created after following the following tutorial: [code-sharing-between-ios-android--web-using-react-native-web](https://dev.to/brunolemos/tutorial-100-code-sharing-between-ios-android--web-using-react-native-web-andmonorepo-4pej)
Which results with the following file content:
```
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
// our packages that will now be included in the CRA build step
const appIncludes = [
resolveApp('src'),
resolveApp('../components/src'),
];
module.exports = function override(config, env) {
// allow importing from outside of src folder
config.resolve.plugins = config.resolve.plugins.filter(
plugin => plugin.constructor.name !== 'ModuleScopePlugin'
);
config.module.rules[0].include = appIncludes;
config.module.rules[1] = null;
config.module.rules[2].oneOf[1].include = appIncludes;
config.module.rules[2].oneOf[1].options.plugins = [
require.resolve('babel-plugin-react-native-web'),
].concat(config.module.rules[2].oneOf[1].options.plugins);
config.module.rules = config.module.rules.filter(Boolean);
config.plugins.push(
new webpack.DefinePlugin({__DEV__: env !== 'production'})
);
return config
};
```
How can I merge this with the required `override` modifications you provided?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.