Home Assistant Cast

This commit is contained in:
Paulus Schoutsen
2019-07-30 10:18:47 -07:00
parent 0544027c38
commit 2da844a1fb
48 changed files with 2709 additions and 12 deletions

View File

@@ -5,7 +5,11 @@ const webpack = require("webpack");
const WebpackDevServer = require("webpack-dev-server");
const log = require("fancy-log");
const paths = require("../paths");
const { createAppConfig, createDemoConfig } = require("../webpack");
const {
createAppConfig,
createDemoConfig,
createCastConfig,
} = require("../webpack");
const handler = (done) => (err, stats) => {
if (err) {
@@ -114,3 +118,53 @@ gulp.task(
)
)
);
gulp.task("webpack-dev-server-cast", () => {
const compiler = webpack([
createCastConfig({
isProdBuild: false,
latestBuild: false,
}),
createCastConfig({
isProdBuild: false,
latestBuild: true,
}),
]);
new WebpackDevServer(compiler, {
open: true,
watchContentBase: true,
contentBase: path.resolve(paths.cast_dir, "dist"),
}).listen(
8080,
// Accessible from the network, because that's how Cast hits it.
"0.0.0.0",
function(err) {
if (err) {
throw err;
}
// Server listening
log("[webpack-dev-server]", "http://localhost:8080");
}
);
});
gulp.task(
"webpack-prod-cast",
() =>
new Promise((resolve) =>
webpack(
[
createCastConfig({
isProdBuild: true,
latestBuild: false,
}),
createCastConfig({
isProdBuild: true,
latestBuild: true,
}),
],
handler(resolve)
)
)
);