Skip to content

Commit 818aa94

Browse files
committed
Introduce single point for localhost ip address for ios webpack
1 parent fc0f912 commit 818aa94

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

CageUI/ios-webpack/app.template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818

1919
<div id="app"></div>
2020
<% if (htmlWebpackPlugin.options.mode === 'dev') { %>
21-
<script src="http://10.134.100.108:<%= htmlWebpackPlugin.options.port %>/<%= htmlWebpackPlugin.options.name %>.js" nonce="<%= htmlWebpackPlugin.options.nonce %>"></script>
21+
<script src="http://<%= htmlWebpackPlugin.options.host %>:<%= htmlWebpackPlugin.options.port %>/<%= htmlWebpackPlugin.options.name %>.js" nonce="<%= htmlWebpackPlugin.options.nonce %>"></script>
2222
<% } %>

CageUI/ios-webpack/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
2121
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
2222
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
2323
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
24+
const host = require("./host.js");
2425

2526
const cwd = path.resolve('./').split(path.sep);
2627
const lkModule = cwd[cwd.length - 1];
@@ -358,6 +359,7 @@ module.exports = {
358359
}),
359360
new HtmlWebpackPlugin({
360361
inject: false,
362+
host: host.ip,
361363
filename: '../../views/gen/' + app.name + '.html',
362364
template: './ios-webpack/app.template.html',
363365
minify: minifyTemplateOptions
@@ -381,6 +383,7 @@ module.exports = {
381383
new HtmlWebpackPlugin({
382384
inject: false,
383385
mode: 'dev',
386+
host: host.ip,
384387
port: watchPort,
385388
name: app.name,
386389
nonce: '<%=scriptNonce%>',

CageUI/ios-webpack/host.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
*
3+
* * Copyright (c) 2026 Board of Regents of the University of Wisconsin System
4+
* *
5+
* * Licensed under the Apache License, Version 2.0 (the "License");
6+
* * you may not use this file except in compliance with the License.
7+
* * You may obtain a copy of the License at
8+
* *
9+
* * http://www.apache.org/licenses/LICENSE-2.0
10+
* *
11+
* * Unless required by applicable law or agreed to in writing, software
12+
* * distributed under the License is distributed on an "AS IS" BASIS,
13+
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* * See the License for the specific language governing permissions and
15+
* * limitations under the License.
16+
*
17+
*/
18+
19+
// Update this IP with your local host ip address.
20+
21+
const hostConfig = {
22+
ip: '10.134.100.108'
23+
}
24+
25+
module.exports = hostConfig;

CageUI/ios-webpack/watch.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ const constants = require('./constants');
2222
const path = require('path');
2323
// relative to the <lk_module>/node_modules/@labkey/build/webpack dir
2424
const entryPoints = require('../src/client/entryPoints.js');
25+
const host = require("host");
26+
2527

2628
const devServer = {
2729
client: {
2830
overlay: true,
2931
},
30-
host: '10.134.100.108',
32+
host: host.ip,
3133
port: constants.watchPort,
3234
hot: true,
3335
headers: {

0 commit comments

Comments
 (0)