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

chore(deps): update react-scripts #1969

Merged
merged 12 commits into from
Jul 21, 2022
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
module.exports = {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
babelOptions: {
presets: ['@babel/preset-react']
}
},
extends: ['react-app', 'standard', 'plugin:jsx-a11y/recommended'],
plugins: ['jsx-a11y'],
// ignore .ts files because it fails to parse it.
Expand Down
30 changes: 30 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* upgrading to react-scripts v5 with any sort of decent sized app causes all kinds of errors
*
* @see https://github.com/facebook/create-react-app/issues/11756#issuecomment-1184657437
* @see https://alchemy.com/blog/how-to-polyfill-node-core-modules-in-webpack-5
*/
const webpack = require('webpack');

module.exports = function override(config) {

const fallback = config.resolve.fallback || {};

Object.assign(fallback, {
"assert": require.resolve('./src/webpack-fallbacks/assert'),
"stream": require.resolve('./src/webpack-fallbacks/stream'),
"os": require.resolve('./src/webpack-fallbacks/os'),
"path": require.resolve('./src/webpack-fallbacks/path'),
})

config.resolve.fallback = fallback;

config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer']
})
])

return config;
}
Loading