Skip to content

Commit

Permalink
Fix for node & npm issues (#2276)
Browse files Browse the repository at this point in the history
* Roll back node version to 16.x for some compatible issue in centos7 env
  * Avoid the generation of app_bundle.js.LICENTSE.txt
  • Loading branch information
ligangty authored Mar 14, 2023
1 parent 9997c2e commit 1189dc0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 44 deletions.
77 changes: 35 additions & 42 deletions addons/content-browse/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion addons/content-browse/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"babel-loader": "^9.1.2",
"webpack": "^5.75.0",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.11.1"
"webpack-dev-server": "^4.11.1",
"terser-webpack-plugin": "^5.3.7"
},
"scripts": {
"webpack": "node node_modules/webpack/bin/webpack.js",
Expand Down
13 changes: 13 additions & 0 deletions addons/content-browse/ui/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ module.exports = {
contentBase: './build/content-browse',
port: 3000
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
}),
],
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader', exclude: /node_modules/ },
Expand Down
14 changes: 14 additions & 0 deletions addons/content-browse/ui/webpack.prod.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
const path = require('path')
const webpack = require('webpack')
const TerserPlugin = require('terser-webpack-plugin')

module.exports = {
entry: './src/main/js/app.js',
Expand All @@ -30,6 +31,19 @@ module.exports = {
}
})
],
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false,
terserOptions: {
format: {
comments: false,
},
},
}),
],
},
module: {
rules: [
{ test: /\.js$/, use: 'babel-loader', exclude: /node_modules/ },
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@
</goals>
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v18.12.1</nodeVersion>
<nodeVersion>v16.19.1</nodeVersion>
<npmVersion>9.4.0</npmVersion>
</configuration>
</execution>
Expand Down

0 comments on commit 1189dc0

Please sign in to comment.