From 467cbda5c66219200ea6e48547a3cf1d3ebe33fc Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 13 May 2019 22:10:41 -0400 Subject: [PATCH] add comments pointing to primary defintion of WEBPACK_PORT --- src/platforms/electron/devServer.js | 6 +++--- static/index.dev.html | 4 ++++ webpack.base.config.js | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/platforms/electron/devServer.js b/src/platforms/electron/devServer.js index b9d87ae9f..85ef85696 100644 --- a/src/platforms/electron/devServer.js +++ b/src/platforms/electron/devServer.js @@ -5,8 +5,8 @@ const middleware = require('webpack-dev-middleware'); const express = require('express'); const app = express(); -// Ideally this would come from the same source that sets this port in webpack.web.config.js -// but we can't inject a variable into this file because it is not being touched by webpack +// Primary definition for this is in webpack.web.config.js +// We can't access it here because webpack isn't running on this file const WEBPACK_PORT = 9090; console.log( @@ -42,7 +42,7 @@ app.use(renderInstance); app.use(express.static('dist/electron/static')); app.listen(WEBPACK_PORT, () => { - console.log(chalk.yellow.bold('Renderer listening on port 9090 (still compiling)')); + console.log(chalk.yellow.bold(`Renderer listening on port ${WEBPACK_PORT} (still compiling)`)); }); mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`))); diff --git a/static/index.dev.html b/static/index.dev.html index e36d3ec63..88166d44b 100644 --- a/static/index.dev.html +++ b/static/index.dev.html @@ -7,6 +7,10 @@
+ diff --git a/webpack.base.config.js b/webpack.base.config.js index 4610f096b..8d67e6c70 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -12,6 +12,11 @@ const { ifProduction } = getIfUtils(NODE_ENV); const UI_ROOT = path.resolve(__dirname, 'src/ui/'); const STATIC_ROOT = path.resolve(__dirname, 'static/'); const DIST_ROOT = path.resolve(__dirname, 'dist/'); + +// There are a two other uses of this value that can't access it from webpack +// They exist in +// src/platforms/electron/devServer.js +// static/index.dev.html const WEBPACK_PORT = 9090; console.log(ifProduction('production', 'development'));