use port 9090 for webpack since internal-apis uses 8080
This commit is contained in:
parent
d6c4463c99
commit
9d9976d77a
7 changed files with 16 additions and 17 deletions
|
@ -19,7 +19,8 @@
|
||||||
"__": true,
|
"__": true,
|
||||||
"__n": true,
|
"__n": true,
|
||||||
"app": true,
|
"app": true,
|
||||||
"IS_WEB": true
|
"IS_WEB": true,
|
||||||
|
"WEBPACK_PORT": true
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"comma-dangle": ["error", "always-multiline"],
|
"comma-dangle": ["error", "always-multiline"],
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"dev": "yarn dev:electron",
|
"dev": "yarn dev:electron",
|
||||||
"dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js",
|
"dev:electron": "cross-env NODE_ENV=development node ./src/platforms/electron/devServer.js",
|
||||||
"dev:web": "cross-env NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js",
|
"dev:web": "cross-env NODE_ENV=development webpack-dev-server --open --hot --progress --config webpack.web.config.js",
|
||||||
"dev:internal-apis": "LBRY_API_URL='http://localhost:9090' yarn dev:electron",
|
"dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
|
||||||
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
|
"run:web": "cross-env NODE_ENV=production yarn compile:web && node ./dist/web/server.js",
|
||||||
"pack": "electron-builder --dir",
|
"pack": "electron-builder --dir",
|
||||||
"dist": "electron-builder",
|
"dist": "electron-builder",
|
||||||
|
|
|
@ -36,7 +36,7 @@ export default appState => {
|
||||||
};
|
};
|
||||||
const lbryProto = 'lbry://';
|
const lbryProto = 'lbry://';
|
||||||
const lbryProtoQ = 'lbry://?';
|
const lbryProtoQ = 'lbry://?';
|
||||||
const rendererURL = isDev ? `http://localhost:8080` : `file://${__dirname}/index.html`;
|
const rendererURL = isDev ? `http://localhost:${WEBPACK_PORT}` : `file://${__dirname}/index.html`;
|
||||||
|
|
||||||
let window = new BrowserWindow(windowConfiguration);
|
let window = new BrowserWindow(windowConfiguration);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const chalk = require('chalk');
|
const chalk = require('chalk');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
|
@ -7,12 +5,9 @@ const middleware = require('webpack-dev-middleware');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// TODO: Spawn separate threads so realtime status logging can be used
|
// Ideally this would come from the same source that sets this port in webpack.web.config.js
|
||||||
// without overwriting information/execptions logged by the compilers
|
// but we can't inject a variable into this file because it is not being touched by webpack
|
||||||
const logRealtime = str => {
|
const WEBPACK_PORT = 9090;
|
||||||
let lineCount = (str.match(/\n/) || []).length + 1;
|
|
||||||
console.log('\u001B[' + lineCount + 'F\u001B[G\u001B[2K' + str);
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
chalk.magenta(`Compiling ${chalk.underline('main')} and ${chalk.underline('render')}, this will take a while.`)
|
chalk.magenta(`Compiling ${chalk.underline('main')} and ${chalk.underline('render')}, this will take a while.`)
|
||||||
|
@ -46,8 +41,8 @@ app.use(require('webpack-hot-middleware')(renderCompiler));
|
||||||
app.use(renderInstance);
|
app.use(renderInstance);
|
||||||
app.use(express.static('dist/electron/static'));
|
app.use(express.static('dist/electron/static'));
|
||||||
|
|
||||||
app.listen(8080, () => {
|
app.listen(WEBPACK_PORT, () => {
|
||||||
console.log(chalk.yellow.bold('Renderer listening on port 8080 (still compiling)'));
|
console.log(chalk.yellow.bold('Renderer listening on port 9090 (still compiling)'));
|
||||||
});
|
});
|
||||||
|
|
||||||
mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`)));
|
mainInstance.waitUntilValid(() => console.log(chalk.green(`${chalk.underline('main')} compilation complete.`)));
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<script type="text/javascript" src="http://localhost:8080/ui.js"></script>
|
<script type="text/javascript" src="http://localhost:9090/ui.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -12,6 +12,7 @@ const { ifProduction } = getIfUtils(NODE_ENV);
|
||||||
const UI_ROOT = path.resolve(__dirname, 'src/ui/');
|
const UI_ROOT = path.resolve(__dirname, 'src/ui/');
|
||||||
const STATIC_ROOT = path.resolve(__dirname, 'static/');
|
const STATIC_ROOT = path.resolve(__dirname, 'static/');
|
||||||
const DIST_ROOT = path.resolve(__dirname, 'dist/');
|
const DIST_ROOT = path.resolve(__dirname, 'dist/');
|
||||||
|
const WEBPACK_PORT = 9090;
|
||||||
|
|
||||||
console.log(ifProduction('production', 'development'));
|
console.log(ifProduction('production', 'development'));
|
||||||
|
|
||||||
|
@ -32,6 +33,10 @@ let baseConfig = {
|
||||||
node: {
|
node: {
|
||||||
__dirname: false,
|
__dirname: false,
|
||||||
},
|
},
|
||||||
|
devServer: {
|
||||||
|
historyApiFallback: true,
|
||||||
|
port: WEBPACK_PORT,
|
||||||
|
},
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
@ -117,6 +122,7 @@ let baseConfig = {
|
||||||
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
'process.env.NODE_ENV': JSON.stringify(NODE_ENV),
|
||||||
'process.env.SDK_API_URL': JSON.stringify(process.env.SDK_API_URL),
|
'process.env.SDK_API_URL': JSON.stringify(process.env.SDK_API_URL),
|
||||||
'process.env.LBRY_API_URL': JSON.stringify(process.env.LBRY_API_URL),
|
'process.env.LBRY_API_URL': JSON.stringify(process.env.LBRY_API_URL),
|
||||||
|
WEBPACK_PORT,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,9 +18,6 @@ const webConfig = {
|
||||||
path: __dirname + '/dist/web',
|
path: __dirname + '/dist/web',
|
||||||
publicPath: '/',
|
publicPath: '/',
|
||||||
},
|
},
|
||||||
devServer: {
|
|
||||||
historyApiFallback: true,
|
|
||||||
},
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue