Skip to content

Commit

Permalink
Use webpack to set the host and port of Dev UI parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmotta committed Sep 19, 2024
1 parent 6461640 commit 52c105d
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 22 deletions.
1 change: 1 addition & 0 deletions packages/runtime-tools-process-dev-ui-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"file-loader": "^6.2.0",
"filemanager-webpack-plugin": "^7.0.0",
"graphql": "14.3.1",
"html-replace-webpack-plugin": "^2.6.0",
"html-webpack-plugin": "^5.3.2",
"https-browserify": "^1.0.0",
"identity-obj-proxy": "^3.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
{ id: "saravana", groups: [] },
{ id: "john", groups: [] },
],
quarkusAppOrigin: "http://localhost:9027",
quarkusAppOrigin: "http://${WEBPACK_REPLACEMENT_WEBAPP_HOST}:${WEBPACK_REPLACEMENT_WEBAPP_PORT}",
quarkusAppRootPath: "",
page: "Processes",
devUIUrl: "http://localhost:9027",
devUIUrl: "http://${WEBPACK_REPLACEMENT_WEBAPP_HOST}:${WEBPACK_REPLACEMENT_WEBAPP_PORT}",
customLabels: {
singularProcessLabel: "Process",
pluralProcessLabel: "Process",
Expand Down
12 changes: 12 additions & 0 deletions packages/runtime-tools-process-dev-ui-webapp/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const MonacoWebpackPlugin = require("monaco-editor-webpack-plugin");
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
const { merge } = require("webpack-merge");
const common = require("@kie-tools-core/webpack-base/webpack.common.config");
const HtmlReplaceWebpackPlugin = require("html-replace-webpack-plugin");

const { env: buildEnv } = require("./env");

module.exports = async (env) => {
Expand Down Expand Up @@ -94,6 +96,16 @@ module.exports = async (env) => {
favicon: "src/favicon.ico",
chunks: ["app"],
}),
new HtmlReplaceWebpackPlugin([
{
pattern: /\${WEBPACK_REPLACEMENT_WEBAPP_HOST}/g,
replacement: () => buildEnv.runtimeToolsProcessDevUIWebapp.host ?? "",
},
{
pattern: /\${WEBPACK_REPLACEMENT_WEBAPP_PORT}/g,
replacement: () => buildEnv.runtimeToolsProcessDevUIWebapp.port ?? "",
},
]),
],
module: {
rules: [
Expand Down
84 changes: 64 additions & 20 deletions pnpm-lock.yaml

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

0 comments on commit 52c105d

Please sign in to comment.