Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

UI updates: minor build config

Rich Turnerd1097bda1153
diff --git a/ui/app/manager/webpack.config.js b/ui/app/manager/webpack.config.js
index cc8f51c25..698101bf6 100644
--- a/ui/app/manager/webpack.config.js
+++ b/ui/app/manager/webpack.config.js
@@ -7,7 +7,7 @@ module.exports = (env, argv) => {
const customConfigDir = env.config;
const managerUrl = env.managerUrl;
const keycloakUrl = env.keycloakUrl;
- const IS_DEV_SERVER = process.argv.find(arg => arg.includes("serve"));
+ const IS_DEV_SERVER = !!process.argv.find(arg => arg.includes("serve"));
const config = util.getAppConfig(argv.mode, IS_DEV_SERVER, __dirname, managerUrl, keycloakUrl);
if (IS_DEV_SERVER && customConfigDir) {
@@ -23,6 +23,12 @@ module.exports = (env, argv) => {
}));
}
+ if (IS_DEV_SERVER) {
+ config.performance = {
+ hints: false
+ };
+ }
+
// Add a custom base URL to resolve the config dir to the path of the dev server not root
config.plugins.push(
new webpack.DefinePlugin({
diff --git a/ui/component/core/src/event.ts b/ui/component/core/src/event.ts
index 84d5b7007..14c580972 100644
--- a/ui/component/core/src/event.ts
+++ b/ui/component/core/src/event.ts
@@ -522,8 +522,6 @@ abstract class EventProviderImpl implements EventProvider {
}
protected _onConnect() {
- console.debug("Event provider connected: " + this.constructor.name);
-
if (Object.keys(this._subscriptionMap).length > 0) {
for (const subscriptionId in this._subscriptionMap) {
if (this._subscriptionMap.has(subscriptionId)) {
@@ -537,7 +535,6 @@ abstract class EventProviderImpl implements EventProvider {
}
protected _onDisconnect() {
- console.debug("Event provider disconnected");
this._onStatusChanged(EventProviderStatus.DISCONNECTED);
if (this._pendingSubscription) {
this._queuedSubscriptions.unshift(this._pendingSubscription);
diff --git a/ui/util/webpack.util.js b/ui/util/webpack.util.js
index b8bf9d7a7..3898ea88a 100644
--- a/ui/util/webpack.util.js
+++ b/ui/util/webpack.util.js
@@ -44,7 +44,7 @@ function getStandardModuleRules() {
function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl) {
const production = mode === "production";
- managerUrl = managerUrl || (production ? undefined : "http://localhost:8080");
+ managerUrl = managerUrl || (production && !isDevServer ? undefined : "http://localhost:8080");
const OUTPUT_PATH = isDevServer ? 'src' : 'dist';
const config = {
@@ -124,7 +124,9 @@ function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl) {
// new ForkTsCheckerNotifierWebpackPlugin({ title: 'TypeScript', excludeWarnings: false }),
...config.plugins
];
+ }
+ if (isDevServer) {
// Load source maps generated by typescript
// config.devtool = 'inline-source-map';
config.module.rules.push(
@@ -185,7 +187,7 @@ function getAppConfig(mode, isDevServer, dirname, managerUrl, keycloakUrl) {
})
);
- config.devtool = production ? false : "inline-source-map";
+ config.devtool = !isDevServer ? false : "inline-source-map";
config.devServer = {
historyApiFallback: {
index: "/" + dirname.split(path.sep).slice(-1)[0] + "/",