Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove react-app-rewired #1696

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Cboard is ready to be deployed.

### `yarn build-cordova-debug`

Use this to produce non-minified build for use in debugging within Cordova. It uses `react-app-rewired` & `config-overrides.js` to customize webpack operation without ejecting react.
Use this to produce non-minified build for use in debugging within Cordova. It uses `craco` & `craco.config` to customize webpack operation without ejecting react.

See [CBoard](https:/nous-/cboard) repo for packaging this CBoard application within Cordova.

Expand Down
9 changes: 0 additions & 9 deletions config-overrides.js

This file was deleted.

15 changes: 12 additions & 3 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@ module.exports = {
resolve: {
extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx']
},
configure: {
ignoreWarnings: [
configure: (webpackConfig, { env, paths }) => {
const isCordovaDebug = process.argv.includes('--cordova-debug');
if (isCordovaDebug) {
webpackConfig.mode = 'development';
webpackConfig.optimization = { minimize: false };
console.log('Cordova debug mode enabled');
}

webpackConfig.ignoreWarnings = [
function ignoreSourcemapsloaderWarnings(warning) {
return (
warning.module?.resource.includes('node_modules') &&
warning.details?.includes('source-map-loader')
);
}
]
];

return webpackConfig;
}
},
babel: {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"babel-plugin-transform-import-meta": "^2.2.1",
"@craco/craco": "^7.1.0",
"@types/mime-types": "^2.1.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"decompress-zip": "^0.3.1",
"enzyme": "^3.11.0",
"enzyme-to-json": "3.3.5",
Expand All @@ -104,7 +104,6 @@
"lint-staged": "^10.0.3",
"node-polyfill-webpack-plugin": "^2.0.1",
"prettier": "1.15.3",
"react-app-rewired": "^2.1.3",
"react-scripts": "5.0.1",
"react-test-renderer": "^17.0.2",
"redux-mock-store": "^1.5.4",
Expand Down Expand Up @@ -150,7 +149,7 @@
"analyze": "source-map-explorer build/static/js/**/*.js",
"start": "craco start",
"build": "craco build --verbose && sw-precache --config=sw-precache-config.js",
"build-cordova-debug": "react-app-rewired build",
"build-cordova-debug": "craco build --verbose --cordova-debug",
"predeploy": "yarn build",
"deploy": "gh-pages -d build",
"test": "craco test",
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11474,13 +11474,6 @@ react-app-polyfill@^3.0.0:
regenerator-runtime "^0.13.9"
whatwg-fetch "^3.6.2"

react-app-rewired@^2.1.3:
version "2.2.1"
resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-2.2.1.tgz#84901ee1e3f26add0377ebec0b41bcdfce9fc211"
integrity sha512-uFQWTErXeLDrMzOJHKp0h8P1z0LV9HzPGsJ6adOtGlA/B9WfT6Shh4j2tLTTGlXOfiVx6w6iWpp7SOC5pvk+gA==
dependencies:
semver "^5.6.0"

react-autosuggest@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/react-autosuggest/-/react-autosuggest-10.1.0.tgz#4d25b8acc78bb518eb70189bb96bcd777dc71ffb"
Expand Down Expand Up @@ -12506,7 +12499,7 @@ semver-diff@^2.0.0:
dependencies:
semver "^5.0.3"

"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.5.0, semver@^5.6.0:
"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.5.0:
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
Expand Down
Loading