refactor: towards server HMR

This commit is contained in:
cha0s 2021-03-22 08:06:07 -05:00
parent d9d3e5a84b
commit 3e9921c2a4
3 changed files with 8 additions and 5 deletions

View File

@ -11,7 +11,7 @@
"electron": "NODE_ENV=production NODE_PATH=./node_modules electron build/electron.js", "electron": "NODE_ENV=production NODE_PATH=./node_modules electron build/electron.js",
"lint": "latus-build lint", "lint": "latus-build lint",
"repl": "rlwrap -C qmp socat STDIO UNIX:$(ls /tmp/latus-*.sock | tail -n 1)", "repl": "rlwrap -C qmp socat STDIO UNIX:$(ls /tmp/latus-*.sock | tail -n 1)",
"server": "LATUS_EXCLUDE_BUILD=http latus-build -d --hot --start-server --inspect", "server": "LATUS_EXCLUDE_BUILD=http latus-build -d --hot --start-server --inspect --watch",
"start": "NODE_ENV=production NODE_PATH=./node_modules node build/index.js", "start": "NODE_ENV=production NODE_PATH=./node_modules node build/index.js",
"test": "latus-build test" "test": "latus-build test"
}, },
@ -53,6 +53,7 @@
"history": "^4.7.2", "history": "^4.7.2",
"is-electron": "^2.2.0", "is-electron": "^2.2.0",
"pixi.js-legacy": "^5.3.7", "pixi.js-legacy": "^5.3.7",
"react-hot-loader": "4.13.0",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"screenfull": "^5.1.0" "screenfull": "^5.1.0"

View File

@ -6,9 +6,8 @@ const neutrino = require('neutrino');
const server = require('./.neutrinorc'); const server = require('./.neutrinorc');
const { const {
LATUS_EXCLUDE_BUILD = '' LATUS_EXCLUDE_BUILD = '',
} = process.env; } = process.env;
const excludeBuilds = LATUS_EXCLUDE_BUILD.split(',').map((name) => name.trim()); const excludeBuilds = LATUS_EXCLUDE_BUILD.split(',').map((name) => name.trim());
module.exports = process.env.LATUS_LINTING module.exports = process.env.LATUS_LINTING
@ -29,9 +28,12 @@ module.exports = process.env.LATUS_LINTING
) )
) )
.map((config) => neutrino(config).webpack()); .map((config) => neutrino(config).webpack());
if (webpackConfigs.length > 0) { if (webpackConfigs.length > 1) {
resolve(webpackConfigs); resolve(webpackConfigs);
} }
if (1 === webpackConfigs.length) {
resolve(webpackConfigs[0]);
}
} }
catch (error) { catch (error) {
reject(error); reject(error);

View File

@ -8414,7 +8414,7 @@ react-hex-editor@^0.3.0:
react-virtualized-auto-sizer "^1.0.2" react-virtualized-auto-sizer "^1.0.2"
react-window "^1.8.5" react-window "^1.8.5"
react-hot-loader@^4.13.0: react-hot-loader@4.13.0, react-hot-loader@^4.13.0:
version "4.13.0" version "4.13.0"
resolved "http://npm.cha0sdev/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202" resolved "http://npm.cha0sdev/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202"
integrity sha512-JrLlvUPqh6wIkrK2hZDfOyq/Uh/WeVEr8nc7hkn2/3Ul0sx1Kr5y4kOGNacNRoj7RhwLNcQ3Udf1KJXrqc0ZtA== integrity sha512-JrLlvUPqh6wIkrK2hZDfOyq/Uh/WeVEr8nc7hkn2/3Ul0sx1Kr5y4kOGNacNRoj7RhwLNcQ3Udf1KJXrqc0ZtA==