Skip to content

Commit 7cdb50d

Browse files
authored
Merge pull request #36 from VadimZvf/VadimZvf/updating-webpack
⬆️ Updating the webpack version
2 parents cec1249 + 4d04a43 commit 7cdb50d

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
],
181181
"dependencies": {
182182
"flux": "~4.0.1",
183-
"react-base16-styling": "~0.6.0",
183+
"react-base16-styling": "~0.9.0",
184184
"react-lifecycles-compat": "~3.0.4",
185185
"react-textarea-autosize": "~8.3.2"
186186
},
@@ -213,7 +213,7 @@
213213
"react-dom": "~16.14.0",
214214
"react-github-button": "~0.1.11",
215215
"react-hot-loader": "~4.13.0",
216-
"react-scripts": "4.0.3",
216+
"react-scripts": "~5.0.1",
217217
"react-select": "~1.1.0",
218218
"react-test-renderer": "~16.14.0",
219219
"sass": "~1.47.0",
@@ -222,19 +222,19 @@
222222
"standard-version": "latest",
223223
"style-loader": "~1.3.0",
224224
"typescript": "^4.5.4",
225-
"webpack": "~4.46.0",
226-
"webpack-bundle-analyzer": "~3.9.0",
225+
"webpack": "~5.93.0",
226+
"webpack-bundle-analyzer": "~4.10.2",
227227
"webpack-bundle-size-analyzer": "~3.1.0",
228-
"webpack-cli": "~3.3.12",
229-
"webpack-dev-server": "~3.11.2"
228+
"webpack-cli": "~5.1.4",
229+
"webpack-dev-server": "~5.0.4"
230230
},
231231
"files": [
232232
"dist",
233233
"index.d.ts"
234234
],
235235
"scripts": {
236-
"build": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack/webpack.config.js -p --display-error-details --progress --optimize-minimize",
237-
"build:demo": "NODE_ENV=production webpack --config webpack/webpack.config-demo.js -p --display-error-details --progress --optimize-minimize",
236+
"build": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack/webpack.config.js --progress",
237+
"build:demo": "NODE_ENV=production webpack --node-env production --config webpack/webpack.config-demo.js --progress",
238238
"dev": "NODE_ENV=development webpack-dev-server --config webpack/webpack.config-dev.js --open",
239239
"lint": "NODE_ENV=test ./node_modules/.bin/eslint src",
240240
"lint-fixup": "NODE_ENV=test ./node_modules/.bin/eslint src --ext .js,.jsx --fix",

webpack/webpack.config-demo.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require('path');
22
const webpack = require('webpack');
3+
const TerserPlugin = require('terser-webpack-plugin');
34

45
const PATHS = {
56
src: path.join(__dirname, '..', 'src'),
@@ -10,6 +11,7 @@ const PATHS = {
1011
};
1112

1213
const config = {
14+
mode: 'production',
1315
entry: [PATHS.demo + '/src/js/entry.js'],
1416
externals: {
1517
react: 'React',
@@ -22,9 +24,6 @@ const config = {
2224
libraryTarget: 'umd'
2325
},
2426
plugins: [],
25-
optimization: {
26-
minimize: true
27-
},
2827
resolve: {
2928
extensions: ['.js', '.json', '.css', '.scss']
3029
},
@@ -54,6 +53,14 @@ const config = {
5453
]
5554
}
5655
]
56+
},
57+
optimization: {
58+
minimize: true,
59+
minimizer: [
60+
new TerserPlugin({
61+
extractComments: false
62+
})
63+
]
5764
}
5865
};
5966

webpack/webpack.config-dev.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const PATHS = {
1010
}
1111

1212
const config = {
13+
mode: 'development',
1314
entry: [PATHS.devServer + "/src/index.js"],
1415
externals: {
1516
react: "React",
@@ -18,10 +19,8 @@ const config = {
1819
devServer: {
1920
host: "localhost",
2021
port: 2000,
21-
hot: true,
22-
inline: true,
2322
historyApiFallback: true,
24-
contentBase: PATHS.build
23+
static: PATHS.build
2524
},
2625
output: {
2726
path: PATHS.build,

webpack/webpack.config.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require("path")
22
const webpack = require("webpack")
3+
const TerserPlugin = require("terser-webpack-plugin");
34

45
const PATHS = {
56
src: path.join(__dirname, "..", "src"),
@@ -9,6 +10,7 @@ const PATHS = {
910
}
1011

1112
const config = {
13+
mode: 'production',
1214
entry: [PATHS.js + "/index.js"],
1315
externals: {
1416
cheerio: "window",
@@ -35,9 +37,6 @@ const config = {
3537
globalObject: "this"
3638
},
3739
plugins: [],
38-
optimization: {
39-
minimize: true
40-
},
4140
resolve: {
4241
extensions: [".js", ".json", ".css", ".scss"]
4342
},
@@ -53,7 +52,15 @@ const config = {
5352
include: [PATHS.js]
5453
}
5554
]
56-
}
55+
},
56+
optimization: {
57+
minimize: true,
58+
minimizer: [
59+
new TerserPlugin({
60+
extractComments: false
61+
}),
62+
],
63+
},
5764
}
5865

5966
module.exports = config

0 commit comments

Comments
 (0)