mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Fix demo development inside a dev container (#21261)
This commit is contained in:
parent
81c796beb4
commit
d833910796
@ -8,6 +8,7 @@
|
|||||||
"postCreateCommand": "sudo apt update && sudo apt upgrade -y && sudo apt install -y libpcap-dev",
|
"postCreateCommand": "sudo apt update && sudo apt upgrade -y && sudo apt install -y libpcap-dev",
|
||||||
"postStartCommand": "script/bootstrap",
|
"postStartCommand": "script/bootstrap",
|
||||||
"containerEnv": {
|
"containerEnv": {
|
||||||
|
"DEV_CONTAINER": "1",
|
||||||
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
|
@ -32,4 +32,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
return version[1];
|
return version[1];
|
||||||
},
|
},
|
||||||
|
isDevContainer() {
|
||||||
|
return process.env.DEV_CONTAINER === "1";
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -40,8 +40,12 @@ const runDevServer = async ({
|
|||||||
compiler,
|
compiler,
|
||||||
contentBase,
|
contentBase,
|
||||||
port,
|
port,
|
||||||
listenHost = "localhost",
|
listenHost = undefined,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (listenHost === undefined) {
|
||||||
|
// For dev container, we need to listen on all hosts
|
||||||
|
listenHost = env.isDevContainer() ? "0.0.0.0" : "localhost";
|
||||||
|
}
|
||||||
const server = new WebpackDevServer(
|
const server = new WebpackDevServer(
|
||||||
{
|
{
|
||||||
hot: false,
|
hot: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user