Skip to content

Commit

Permalink
Merge pull request #36 from VadimZvf/VadimZvf/updating-webpack
Browse files Browse the repository at this point in the history
⬆️ Updating the webpack version
  • Loading branch information
Kikobeats authored Sep 22, 2024
2 parents cec1249 + 4d04a43 commit 7cdb50d
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
],
"dependencies": {
"flux": "~4.0.1",
"react-base16-styling": "~0.6.0",
"react-base16-styling": "~0.9.0",
"react-lifecycles-compat": "~3.0.4",
"react-textarea-autosize": "~8.3.2"
},
Expand Down Expand Up @@ -213,7 +213,7 @@
"react-dom": "~16.14.0",
"react-github-button": "~0.1.11",
"react-hot-loader": "~4.13.0",
"react-scripts": "4.0.3",
"react-scripts": "~5.0.1",
"react-select": "~1.1.0",
"react-test-renderer": "~16.14.0",
"sass": "~1.47.0",
Expand All @@ -222,19 +222,19 @@
"standard-version": "latest",
"style-loader": "~1.3.0",
"typescript": "^4.5.4",
"webpack": "~4.46.0",
"webpack-bundle-analyzer": "~3.9.0",
"webpack": "~5.93.0",
"webpack-bundle-analyzer": "~4.10.2",
"webpack-bundle-size-analyzer": "~3.1.0",
"webpack-cli": "~3.3.12",
"webpack-dev-server": "~3.11.2"
"webpack-cli": "~5.1.4",
"webpack-dev-server": "~5.0.4"
},
"files": [
"dist",
"index.d.ts"
],
"scripts": {
"build": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack/webpack.config.js -p --display-error-details --progress --optimize-minimize",
"build:demo": "NODE_ENV=production webpack --config webpack/webpack.config-demo.js -p --display-error-details --progress --optimize-minimize",
"build": "NODE_OPTIONS=--openssl-legacy-provider NODE_ENV=production webpack --config webpack/webpack.config.js --progress",
"build:demo": "NODE_ENV=production webpack --node-env production --config webpack/webpack.config-demo.js --progress",
"dev": "NODE_ENV=development webpack-dev-server --config webpack/webpack.config-dev.js --open",
"lint": "NODE_ENV=test ./node_modules/.bin/eslint src",
"lint-fixup": "NODE_ENV=test ./node_modules/.bin/eslint src --ext .js,.jsx --fix",
Expand Down
13 changes: 10 additions & 3 deletions webpack/webpack.config-demo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');

const PATHS = {
src: path.join(__dirname, '..', 'src'),
Expand All @@ -10,6 +11,7 @@ const PATHS = {
};

const config = {
mode: 'production',
entry: [PATHS.demo + '/src/js/entry.js'],
externals: {
react: 'React',
Expand All @@ -22,9 +24,6 @@ const config = {
libraryTarget: 'umd'
},
plugins: [],
optimization: {
minimize: true
},
resolve: {
extensions: ['.js', '.json', '.css', '.scss']
},
Expand Down Expand Up @@ -54,6 +53,14 @@ const config = {
]
}
]
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false
})
]
}
};

Expand Down
5 changes: 2 additions & 3 deletions webpack/webpack.config-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const PATHS = {
}

const config = {
mode: 'development',
entry: [PATHS.devServer + "/src/index.js"],
externals: {
react: "React",
Expand All @@ -18,10 +19,8 @@ const config = {
devServer: {
host: "localhost",
port: 2000,
hot: true,
inline: true,
historyApiFallback: true,
contentBase: PATHS.build
static: PATHS.build
},
output: {
path: PATHS.build,
Expand Down
15 changes: 11 additions & 4 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require("path")
const webpack = require("webpack")
const TerserPlugin = require("terser-webpack-plugin");

const PATHS = {
src: path.join(__dirname, "..", "src"),
Expand All @@ -9,6 +10,7 @@ const PATHS = {
}

const config = {
mode: 'production',
entry: [PATHS.js + "/index.js"],
externals: {
cheerio: "window",
Expand All @@ -35,9 +37,6 @@ const config = {
globalObject: "this"
},
plugins: [],
optimization: {
minimize: true
},
resolve: {
extensions: [".js", ".json", ".css", ".scss"]
},
Expand All @@ -53,7 +52,15 @@ const config = {
include: [PATHS.js]
}
]
}
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false
}),
],
},
}

module.exports = config

0 comments on commit 7cdb50d

Please sign in to comment.