Skip to content

Commit ab43c69

Browse files
author
Anton Mogdalov
committed
Updated react-scripts to version 5 (webpack 5)
1 parent 3bfbc07 commit ab43c69

File tree

4 files changed

+4923
-5348
lines changed

4 files changed

+4923
-5348
lines changed

config-overrides.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const webpack = require("webpack")
2+
const path = require("path")
3+
module.exports = function override(config) {
4+
const fallback = config.resolve.fallback || {}
5+
Object.assign(fallback, {
6+
crypto: require.resolve("crypto-browserify"),
7+
stream: require.resolve("stream-browserify"),
8+
assert: require.resolve("assert"),
9+
http: require.resolve("stream-http"),
10+
https: require.resolve("https-browserify"),
11+
os: require.resolve("os-browserify"),
12+
url: require.resolve("url"),
13+
vm: require.resolve("vm-browserify"),
14+
})
15+
config.resolve.fallback = fallback
16+
config.plugins = (config.plugins || []).concat([
17+
new webpack.ProvidePlugin({
18+
process: "process/browser",
19+
Buffer: ["buffer", "Buffer"],
20+
}),
21+
])
22+
const modules = config.resolve.modules
23+
config.resolve.modules = [...modules, path.resolve(__dirname, "src")]
24+
config.module.rules.push({
25+
test: /\.m?js/,
26+
resolve: {
27+
fullySpecified: false,
28+
},
29+
})
30+
return config
31+
}

package.json

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"version": "8.2.2",
44
"private": true,
55
"scripts": {
6-
"build": "cross-env REACT_APP_BACKEND=true cross-env PUBLIC_URL='./' react-scripts --openssl-legacy-provider build",
7-
"start": "react-scripts --openssl-legacy-provider start",
8-
"start:backend": "cross-env REACT_APP_BACKEND=true react-scripts --openssl-legacy-provider start",
9-
"test": "react-scripts --openssl-legacy-provider test"
6+
"build": "cross-env REACT_APP_BACKEND=true cross-env PUBLIC_URL='./' react-app-rewired --openssl-legacy-provider build",
7+
"start": "react-app-rewired --openssl-legacy-provider start",
8+
"start:backend": "cross-env REACT_APP_BACKEND=true react-app-rewired --openssl-legacy-provider start",
9+
"test": "react-app-rewired --openssl-legacy-provider test"
1010
},
1111
"browserslist": [
1212
">0.2%",
@@ -28,11 +28,15 @@
2828
"@fullcalendar/timegrid": "5.11.0",
2929
"animate.css": "4.1.1",
3030
"apexcharts": "^3.40.0",
31+
"assert": "^2.1.0",
3132
"awesome-bootstrap-checkbox": "https://github.com/flatlogic/awesome-bootstrap-checkbox#bump-to-bootstrap5",
3233
"axios": "^0.27.2",
3334
"bootstrap": "5.2.3",
35+
"bootstrap-icons": "^1.11.3",
36+
"buffer": "^6.0.3",
3437
"classnames": "^2.3.2",
3538
"connected-react-router": "6.9.3",
39+
"crypto-browserify": "^3.12.0",
3640
"draft-js": "^0.11.7",
3741
"echarts": "^4.9.0",
3842
"echarts-for-react": "^2.0.16",
@@ -44,13 +48,16 @@
4448
"highcharts": "^10.3.3",
4549
"highcharts-react-official": "^3.2.0",
4650
"history": "^4.10.1",
51+
"https-browserify": "^1.0.0",
4752
"jasny-bootstrap": "^4.0.0",
4853
"jsonwebtoken": "^8.5.1",
4954
"line-awesome": "^1.3.0",
5055
"md5": "^2.3.0",
5156
"messenger": "https://github.com/HubSpot/messenger.git",
5257
"moment": "^2.29.4",
5358
"nvd3": "1.8.6",
59+
"os-browserify": "^0.3.0",
60+
"process": "^0.11.10",
5461
"rc-color-picker": "^1.2.6",
5562
"rc-hammerjs": "0.6.10",
5663
"rc-slider": "^9.7.5",
@@ -59,7 +66,9 @@
5966
"react-animated-number": "^0.4.4",
6067
"react-apexcharts": "^1.4.0",
6168
"react-app-polyfill": "^0.2.2",
69+
"react-app-rewired": "^2.2.1",
6270
"react-autosize-textarea": "^5.0.1",
71+
"react-bootstrap-icons": "^1.11.4",
6372
"react-bootstrap-table": "4.3.1",
6473
"react-bootstrap-table-next": "^3.3.5",
6574
"react-bootstrap-table2-paginator": "^2.1.2",
@@ -77,6 +86,7 @@
7786
"react-router": "5.3.3",
7887
"react-router-dom": "5.3.3",
7988
"react-router-hash-link": "^2.4.3",
89+
"react-scripts": "^5.0.1",
8090
"react-scrollspy": "^3.4.3",
8191
"react-select": "^3.2.0",
8292
"react-shuffle": "2.1.0",
@@ -95,17 +105,18 @@
95105
"redux": "^4.2.1",
96106
"redux-thunk": "^2.4.1",
97107
"rickshaw": "1.7.1",
98-
"react-scripts": "^3.4.4",
99108
"sass": "^1.69.5",
100109
"sass-loader": "^10",
101110
"showdown": "^1.9.1",
102111
"skycons": "^1.0.0",
103112
"sortablejs": "1.15.1",
113+
"stream-browserify": "^3.0.0",
114+
"stream-http": "^3.2.0",
104115
"styled-components": "^5.3.10",
116+
"url": "^0.11.4",
105117
"uuid": "^8.3.2",
106-
"yup": "^0.32.11",
107-
"react-bootstrap-icons": "^1.11.4",
108-
"bootstrap-icons": "^1.11.3"
118+
"vm-browserify": "^1.1.2",
119+
"yup": "^0.32.11"
109120
},
110121
"engines": {
111122
"node": "^20.15"

src/pages/tables/dynamic/Dynamic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import classnames from 'classnames';
1212
import BootstrapTable from 'react-bootstrap-table-next';
1313
import paginationFactory from 'react-bootstrap-table2-paginator';
14-
import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit';
14+
import ToolkitProvider, { Search } from "react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit"
1515

1616
import ReactTable from 'react-table';
1717

0 commit comments

Comments
 (0)